This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: eval inside let
Keith Wright writes:
> > From: thi <ttn@mingle.glug.org>
> >
> > (let ((foo 'bar)) (local-eval (display foo) the-environment))
> >
> > note that you don't need to quote the first arg.
>
> If true, that would be a bug. The whole point of EVAL is to evaluate
> an expression constructed on the fly. If it auto-quotes everything
> it becomes just a stupid name for the identity function.
>
> > (hmm, when i use a quote, guile seems to hang
>
> I dare anybody to say that isn't (or wouldn't be) a bug.
>
It's a feature, not a bug
> -- does anyone else see this?)
>
> I don't. I get "ERROR: Unbound variable: the-environment" whether I
> quote or not.
>
> On the other hand, if you think you need this function (LOCAL-EVAL),
> you may be way off base. Ask yourself: how would I write this in C?
Yeah, how would one write it in C without having to recompile stuff?
> Many people who think they want some flavor of EVAL really want to
> treat functions as data, which is much simpler.
>
May you give a few examples to elucidate the difference?
Klaus Schilling