This is the mail archive of the guile@cygnus.com mailing list for the guile project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Apologies if my last mail on the same subject made it out - I'm assuming it
didn't.
I've quickly come to the conclusion that I need OO in the stuff I'm playing
with.
I've been to the Scheme repository and settled on tiny-clos for various reasons.
After playing with it a little (providing a 'sort' function that I stole from
'elk') I am stuck fast...
I can get all the scaffolding of CLOS to load but then :
(define <primitive-class>
(make <class>
'direct-supers (list <class>)
'direct-slots (list)))
which actually creates the first class - a subclass of itself, the crucial
circular bootstrapping bit, crashes and burns - like this :
Backtrace:
4* [#<procedure (class . initargs)> #<procedure <class> args> direct-supers
...]
5 (let ((instance #)) (initialize instance initargs) ...)
6* [initialize #<procedure args> (direct-supers (#<procedure <class> args>)
direct-slots ...)]
7 [apply #<procedure args> (#<procedure args> (direct-supers # direct-slots
...))]
...
8 [#<procedure (methods args)> ...
9* [#<procedure (args)> (#<procedure args> (direct-supers # direct-slots
...))]
10 (let ((applicable #)) (gsort (lambda # #) applicable))
...
11 [vector->list ...
12* [sort! #(#<procedure args> #<procedure args>) #<procedure (m1 m2)>]
13 (let ((len #)) (if (> len 1) (internal-sort 0 #)) ...)
14* (if (> len 1) (internal-sort 0 (1- len)))
15 [internal-sort 0 1]
16
Exception during displaying of backtrace: signal
./tiny-clos-1.7/tiny-clos.scm:670:20: In procedure error in expression (error
"Two methods are equally specific."):
./tiny-clos-1.7/tiny-clos.scm:670:20: Two methods are equally specific.
ABORT: (misc-error)
guile>
The call to 'sort' looks suspicious, but I don't think it is the problem. The
predicate passed into sort is actually calling 'error' because it believes two
of the methods it is trying to order have the same specialisers.
Tiny-clos (1.7) appears to work with the following R4 Schemes : mit, chez, scm,
scheme48.
It looks like I have come up against a difference in behaviour between them and
Guile.
I have tried to break at the crucial point - but although the documentation
mentions breakpoints I cannot find out how to set them. Half of the doc is
missing on how the debugger works.
I haven't the time to figure this one out....
Has anyone else already been through this ?
Is anyone interested ?
Is there already a decent, working MOP available for Guile ?
Jules