Hi, Panicz Maciej Godek <godek.mac...@gmail.com> skribis:
> I recall someone having the idea of adding smalltalk-like images to guile. > I'd love to see such feature one day, but if guile is supposed to be > an extension language, I think the C interface would need to be > redesigned, because there would be a need to somehow dump the smobs > from the heap to re-load them later. At the C level, that seems somewhat ambitious. :-) > I don't know much about the implementation of the GOOPS objects, but I > suspect that they would also require some means of serialization The (oop goops save) module implements parts of a serialization framework. When GOOPS is loaded, any Scheme object is a GOOPS instance, so one could define methods to serialize any type of object. [...] > then I could easily implement this functionality myself (making 'self' > a reserved keyword) > > (define-syntax lambda > (syntax-rules () > ((_ args body ...) > (let ((self (primitive-lambda args body ...))) > (set-procedure-property! self 'source (quote (primitive-lambda > args body ...))) > self)))) Note that this doesn’t make ‘self’ a reserved keyword; instead, it’s just a local variable that cannot be referred to by name in BODY, thanks to the macro hygiene rules. Thanks, Ludo’.