guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: procedure-source availability


From: Ludovic Courtès
Subject: Re: procedure-source availability
Date: Thu, 04 Oct 2012 21:40:24 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Hi,

Panicz Maciej Godek <address@hidden> 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’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]