[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions, loose ends, misprints, etc.

 Per Bothner wrote:
 > (library "foo-counter" "scheme://r6rs"
 >    (export get-foo incr-foo)
 >    (define foo 1)
 >    (define-syntax get-foo
 >      (syntax-rules ()
 >        ((get-foo)
 >         foo)))
 >    (define-syntax incr-foo
 >      (syntax-rules ()
 >        ((incr-foo)
 >         (set! foo (+ foo 1))))))
 > In the example, get-foo and incr-foo are exported, but foo itself is
 > not.  The compiler can prove that foo is never modified expect by
 > using incr-foo.  
 This statement does not seem correct to me.  This fact would only 
 become apparent after use of a macro in the client code.  
 The line (set! foo ....) is compiled at the use site during 
 compilation of the client, not at the macro definition site.