From: ludo@gnu.org (Ludovic Courtès)
To: guile-user@gnu.org
Subject: Re: procedure-source availability
Date: Thu, 04 Oct 2012 21:40:24 +0200 [thread overview]
Message-ID: <87txuakouv.fsf@gnu.org> (raw)
In-Reply-To: CAMFYt2aSAtyfBhVgDhX2iaJ2-q-=EMfN8N-XKxYocpAu+UG20g@mail.gmail.com
Hi,
Panicz Maciej Godek <godek.maciek@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’.
next prev parent reply other threads:[~2012-10-04 19:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-23 19:05 procedure-source availability Panicz Maciej Godek
2012-09-30 20:11 ` Panicz Maciej Godek
2012-10-01 3:40 ` Mark H Weaver
2012-10-01 16:31 ` Panicz Maciej Godek
2012-10-02 14:06 ` Ludovic Courtès
2012-10-02 19:29 ` Panicz Maciej Godek
2012-10-03 1:03 ` Daniel Hartwig
2012-10-03 16:27 ` Panicz Maciej Godek
2012-10-04 19:40 ` Ludovic Courtès [this message]
2012-10-07 0:07 ` Panicz Maciej Godek
2012-10-07 20:36 ` Ludovic Courtès
2012-10-08 20:11 ` Panicz Maciej Godek
2012-10-08 17:57 ` Mark H Weaver
2012-10-04 16:16 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87txuakouv.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).