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

Re: macros vs. blocks




On Fri, 22 Nov 2002, John Clements wrote:
> >>    ASSERTION FAILURE: (> x 0).
> >>
> >> is pretty darn useless, since there might be lots of occurrences of
> >> (assert (> x 0)) in the code, and also that assertion failures often
> >> indicate an error in the caller rather than where the assert statement
> >> is. I'd much rather rely on the stack traceback with line numbers and
> >> function arguments that any good interpreted language gives you. So I
> >> claim this sort of pun is pretty useless.
> >
> > That is a quality of implementation issue.  There is no reason that a
> > macro
> > system cannot allow you to write macros that refer to the source file
> > and
> > line where the macro is expanded.
>
> Indeed.  cf. PLT scheme.

Ok, but you're moving away from the advantage of having it be a macro:
"there is no reason that a runtime system cannot allow you to write
functions that refer to the source file and line from which the function
was called".  The purpose of bringing up assert was that it could both
evaulate and quote the same piece of code; once you start bringing in
message strings and line numbers, the argument for macros gets diluted.