[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: another take on hackers and painters
On Mittwoch, Mai 21, 2003, at 01:36 Uhr, Michael Sperber [Mr.
Preprocessor] wrote:
>>>>>> "Lauri" == Lauri Alanko <la@iki.fi> writes:
>
> Lauri> The real challenge is making eval'ed code interact with the
> Lauri> runtime environment of the host program:
>
> Lauri> (define x 'foo)
> Lauri> (eval '(set! x 'bar))
> Lauri> x
> Lauri> ==> bar
>
> Lauri> And this is non-trivial to do safely in a statically typed
> language.
>
> That's non-trivial to do safely in *any* language. Specifically, the
> above code fragment isn't legal in R5RS. Even if you added
> (interaction-environment) as an operarand, the behavior would still be
> unspecified.
Welcome to Macintosh Common Lisp Version 5.0!
? (setq x 'foo)
foo
? (eval '(setq x 'bar))
bar
? x
bar
What's the problem?
Pascal