From: Brian Harvey <[email protected]>
Subject: Re: [r6rs-discuss] Proposed features for small Scheme, part 1: a stake 
in the ground
Date: Fri, 11 Sep 2009 22:14:47 -0700

> >  (import (foo-library))   ; imports name "foo", possibly a syntax.
> >  (define x (foo 42))
> >  (define (foo n) (* n n))
> 
> I am only an egg, but I don't understand why this is a hard and/or
> contentious question.  The (foo 42) is evaluated once, when the first
> define is seen, and its value is bound to X.  (Yeah, yeah, don't tell me
> about locatives.)
> 
> Did you mean (define (X) (foo 42))?
>                      ---

You're right.  I tried to make it simple but my example was too
simple to be interesting.

> Then there might be an interesting question about which foo will be used
> when procedure X is invoked.  To which I say, the one that squares its
> argument, as provided in the later define.  Once again (sorry for keeping
> banging on this point), that is the only behavior consistent with the
> last 50 years of REPLs, and the only behavior any Lisp-family language
> will ever have.

What if imported 'foo' was a macro/syntax?  

Even Common Lisp seems unclear in that case (correct me if I'm wrong).

In CLisp 2.42, at the definition of x the imported macro is expanded
and the subsequent redefinition of foo doesn't affect x.

Allegro CL 8.1 is smart enough to warn me when I redefine foo.
The behavior of x is altered after redefinition of foo as far as
it is interpreted; if I compile x before redefining foo, the
redefinition doesn't take effect.

--shiro


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to