[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: macros vs. blocks
In a message dated 11/22/02 8:33:44 PM, email@example.com writes:
>> That is a quality of implementation issue. There is no reason that a
>> system cannot allow you to write macros that refer to the source file
>> line where the macro is expanded.
>Or even the file+line where a function is called from, like in Perl, so
>you can write assert as a function, and even get a whole stack trace. I
>think we've shot the assert macro example full of holes.
Ummm... have you tried writing such macros in PLT Scheme?
That, I believe, is the system referred to in the quoted text
("a quality of implementation issue"). Macros can raise syntax
errors in terms of the location of the actual source code, rather
than in terms of the expanded code.
The errors raised by "built in" macros in PLT are really good
examples of *the right thing*. In many cases, PLT is a good
example of having "correct source location", macros, and
a stack trace.
<disclaimer>I am not a PLTer, just an enthusiastic user</disclaimer>
Don't trash the assert macro till you've tried writing with PLT