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

Re: eval'd macros (the other point of view)



  
    Having macros expanded when the defun is first seen offers the nice feature
    that you can't easily break functions you've already written as you enter a
    debugging phase.
  
  You also can't FIX functions you've already written by changing the
  macros they call.  You now have to go back and find every last function
  that calls FOO, and re-expand it to do the right thing, assuming that
  you've got the source handy.  Things that I'm sure are right and that I
  don't want to break are usually already compiled.

One advantage of having the interpreter expand macros when it sees a DEFUN is
that it would reduce the differences between the compiler and the interpreter.
(Of course, this may be exactly the kind of difference you want to preserve.)
And, as has been mentioned, you would then know that all macro calls had been
expanded, not just those that had been evaluated.  You could still fix these
functions by changing the macro if the macro expansion was memoized in such a
way that it noticed when the macro was redefined.  Similarly, if you didn't
want to break functions when the macro was redefined, some way of inhibiting
their noticing the redefinition could be provided.

-- Jeff