[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Macros and DrScheme
I'm not sure this would be considered a bug, so I'm mailing this.
It seems like macros that override primitives (like lambda) behave
differently in DrScheme 102 than 101, or MzScheme. I would expect
this:
| Welcome to MzScheme version 102, Copyright (c) 1995-2000 PLT (Matthew Flatt)
| > (parameterize ((current-namespace (make-namespace)))
| (eval '(define-macro lambda (lambda x `(#%+ ,@x))))
| (eval '(lambda 1 2)))
| 3
| > (lambda 1 2)
| lambda: bad identifier at: 1 in: (lambda 1 2)
| > (#%lambda 1 2)
| lambda: bad identifier at: 1 in: (#%lambda 1 2)
to behave the same in DrScheme, but:
| Welcome to DrScheme, version 102.
| Language: Graphical Full Scheme (MrEd).
| > (parameterize ((current-namespace (make-namespace)))
| (eval '(define-macro lambda (lambda x `(#%+ ,@x))))
| (eval '(lambda 1 2)))
| 3
| > (lambda 1 2)
| 3
| > (#%lambda 1 2)
| 3
... it does work as expected when the no-debugging versions are used.
So the question is: is this a bug? Is it possible to modify these
things by hacking DrScheme? (which I did for my Swindle thing for the
lack of a sane way to have teachpacks or tools that define macros).
BTW, the
http://www.cs.rice.edu/CS/PLT/packages/102/DocBundles/framework-doc.plt
file is missing.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.cs.cornell.edu/eli/meaning.html Maze is Life!