[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
macros vs. blocks
If anyone has good examples of macros that *can't* be
expressed with a convenient notation for closures, it would
be interesting to see them. My Smalltalk-hacking friend
Trevor Blackwell has often claimed that macros were
unnecessary if you had blocks, so as long as we're on
the subject, please send him (and ll1-discuss) your
counterexamples.
(The point is not mainly to quiet Trevor, of course, but
to understand macros better.)
Thanks! --pg
--Daniel Weinreb wrote:
> Jonathan Bachrach wrote:
>
> >matthias,
> >
> >i* never said that having a lightweight lambda notation _eliminates_
> >the need for syntactic abstraction. i said instead that macros become
> >less necessary. i said that many of the common** uses of macros can
> >be conveniently expressed in this lightweight lambda notation (e.g.,
> >smalltalk's blocks) without resorting to macros.
> >
> That is my experience as well. The vast majority of Lisp macros that I
> ever wrote could
> (and therefore should) have been done without using macros had there
> been available
> the proper lambda stuff (lexical scoping, "funargs", and so on). Macros
> would still
> have been very useful and important but they would have been used far
> less often,
> only in cases where something more profound was going on than with-open-file
> or define-zmacs-command or dotimes. So I think you were both agreeing;
> there
> was just a small miscommunication.
>
>
>