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

Re: need for macros (was Re: Icon)

   From: Matthias Felleisen <matthias@ccs.neu.edu>
   To: ll1-discuss@ai.mit.edu
   Subject: need for macros (was Re: Icon)
   Date: Thu, 20 Dec 2001 20:47:13 -0500 (EST)
   la@iki.fi writes: 
     Note that there is no need for any syntax transformations, this is pure
     Haskell. You can get surprisingly far without macros when just about
     everything is a first-class value...
   That's not true.
I dare say that what Lauri Alanko wrote *is* true:

(a) There is no need for any syntax transformations *for this
particular problem*, namely expressing (a simplified version of)
the Icon success/failure/generator mechanism.
(b) You can indeed "get surprisingly far without macros" when
everything, including functions, is a first class value.

                   There are three reasons for introducing a syntactic
   abstraction (macro) rather than a function:
    1. new binding forms
    2. implicit quoting or, more generally, a data sub-language
    3. an order of evaluation that is incompatible with evaluation 
   A lazy language makes macros fro 3 unnecessary. A function with first-class
   functions still needs macros for 1; otherwise you keep writing 
     foo (fn x => ...)
   all over the place. 

And what Matthias has written here is also true (and important).