unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: tomas@fabula.de
Cc: Guile Users <guile-user@gnu.org>
Subject: Re: Req for help on objects and environments
Date: Mon, 6 Sep 2004 08:17:53 +0200	[thread overview]
Message-ID: <20040906061753.GA21509@www> (raw)
In-Reply-To: <1094237209.3785.48.camel@lark>

On Fri, Sep 03, 2004 at 07:46:49PM +0100, Andy Wingo wrote:
> Hi Alp,
> 

[...]

> Lexical environments are a different beast. You cannot access them with
> r5rs, I don't think. However, with guile you can, although it's
> definitely not documented. I tried to be less hacky with the following
> macro, but define-macro's memoizing behaviour caused guile 1.6 to
> segfault, so I had to use low-level macros:
> 
> (define make-environment
>   (procedure->syntax
>    (lambda (exp env)
>      (local-eval `(let* ,(let lp ((in (cdr exp)) (out '()))
>                            (if (null? in)
>                                (reverse out)
>                                (lp (cddr in) (cons
>                                               (list (car in) (cadr in)) 
>                                               out))))
>                     (the-environment))
>                  env))))

Thanks for your insightful post. As a (mostly) lurker and (currently) non-
schemer (shame!) I appreciate this.

Suggestion: Maybe call your macro make-local-environment -- that might help
newbies to keep apart those two beasts better.

Regards
-- tomás


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2004-09-06  6:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-01  8:28 Req for help on objects and environments Alp Öztarhan
2004-09-03 18:46 ` Andy Wingo
2004-09-06  6:17   ` tomas [this message]
2004-09-21 20:47   ` Marius Vollmer
2004-09-22 17:07     ` Andy Wingo
  -- strict thread matches above, loose matches on Subject: below --
2004-09-02 11:09 [Fwd: Req for help on objects and environments] Alp Öztarhan
2004-09-02 11:53 ` tomas
2004-09-03 19:10   ` Req for help on objects and environments Andy Wingo

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=20040906061753.GA21509@www \
    --to=tomas@fabula.de \
    --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).