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

Re: choosing a language for your audience or macros vs syntax?



--- Daniel Weinreb <DLWeinreb@attbi.com> wrote:
> 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...

I had a great discussion about this very topic on
Wiki:

   http://c2.com/cgi/wiki?LispMacroDiscussion

My canonical example of a macro that isn't a simple
replacement of lambda is the match macro.  I use it
everyday in my programming.  It's more-or-less ML
style pattern matching:

  (define (map fn list)
    (match list
      [(head . rest) (cons (fn head) (map fn rest))]
      [() '()]))

I have mixed feelings about changing if to take
lambdas.  In a sense having if as a special form falls
out naturally from 1) using the lambda calculus as a
base and 2) taking the decision to use eager
evaluation.  Requiring the programmer to patch things
to be lazy in some cases feels clumsy to me.

Noel

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com