[plt-scheme] expansion of internal define v. set!
(define-syntax f
(syntax-rules ()
((f e) (define e 'by-syntax))))
(define-syntax f
(syntax-rules ()
((f e) (set! e 'by-syntax))))
(let ((x 'undefined))
(define (f _) (set! x 'by-procedure))
(f x)
x)
Using the first syntax definition of f results in 'by-syntax, but using the
second results in 'by-procedure. I'm not sure what the right behavior is, but
it seems like either 'by-syntax or 'by-procedure should be returned in both
cases. Is this a bug or am I missing some subtlety in macros that expand into
definitions? (I tried this in a module and observed the same behavior.)
(The other Schemes I have lying around, MIT and 48, return 'by-procedure in
both cases.)
-d