On Wed, 2009-09-30 at 00:04 -0500, Eduardo Cavazos wrote: > Next step is to decouple everything. I.e. be able to have a library > '(sequence-protocol)' with stuff like: > > (define-generic nth ...) > > (define-generic len ...) > > etc ... > > These get registered somewhere. > > Then other libraries like (sequence-list), (sequence-string), etc. can > flesh out the protocol for specific sequence types. These libraries add > "methods" to the generics. They have the effect of annotating the > generic registries. > > Finally, 'define-typed' consults this generic registry to do "the right > thing".
Remember that the registry must always exist at the time the define-typed macro transformer runs. Separate compilation of libraries (e.g. those defining define-typed and the stuff which works with it) means that side-effects done to instances of variables do not persist when those instances die (after the separate compilation is done) and are instantiated another time. Maybe the registry can be a separate file, though I don't know how updating it and keeping it consistent will work-out. -- : Derick ----------------------------------------------------------------
