lua-users home
lua-l archive

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


Fabien <fleutot+lua@gmail.com> writes:
> We know how to package functions and data structures in modular,
> reusable ways; we don't know how to do that with macros, so macros
> hurt code reuse.

I dunno, while much of what you say makes sense, I just don't see this
kind of problem in lisp, at least with the simple lisp-2 macros I'm
familiar with (the lack of hygiene etc presents some opportunity for
problems, but lisp programmers all know the drill by now, and this
doesn't seem to be much of an issue these days, in lisp-2s at least).

That is, people _do_ use macros in lisp, and they don't stand out as a
particular problem with respect to code re-use.

Part of the reason is that in lisp, macros are keyed off the car of the
form, and you don't get the sort of syntax clashes you might get with a
more poweful and arbitrary syntax rewriting system.

Another, perhaps, is that lisp has developed a widely followed set of
conventions with respect to macro usage, and lisp programmers tend to be
fairly conservative in their usage of macros (these days, at least
... in the past we got wacky things such as "loop"...).

-Miles

-- 
Admiration, n. Our polite recognition of another's resemblance to ourselves.