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

Re: macros vs. blocks

   Date: Fri, 22 Nov 2002 13:04:25 -0800 (PST)
   From: Avi Bryant <avi@beta4.com>
   To: Trevor Blackwell <tlb@anybots.com>, <ll1-discuss@ai.mit.edu>
   Subject: 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".  ...

Sure there is: as a matter of efficiency, it might well
be undesirable or infeasible to keep all that information
around at run time on the off chance that someone might
need part of it.

Maybe you think that's a stupid or insufficient reason,
but it is a reason, which suffices to rebut the claim
that there is no reason.

--Guy Steele