Re: Explanation of macros; Haskell macros

From: Kenny Tilton (ktilton_at_nyc.rr.com)
Date: 10/07/03


Date: Tue, 07 Oct 2003 04:13:50 GMT


mike420@ziplip.com wrote:
> I think others dropped the ball while trying to explain macros
> to non-Lispers recently.

...<snip>

> Let's say you do not have the "for" keyword, but you have
> "dolist" for iterating a list and "dotimes" - a simple
> index loop. You want to create "for" just like in Python,

Wow, talk about dropping the ball. Translation: "You should learn Lisp
because it has macros so you can recreate Python in Lisp and not learn
Lisp."

If you want to be an educator, you gotta motivate your students. Your
macro was fine in all regards except that its motivation ("avoid Lisp by
learning advanced Lisp!") is, um, unconvincing.

kenny



Relevant Pages

  • Re: Python gets macros - now XML does too
    ... why I asked you to provide a translation of my ... >> cumbersome to implement the code generation part in another language ... You have indeed misunderstood basically _everything_ about what Lisp ... macros are and what capabilities they provide. ...
    (comp.lang.lisp)
  • Re: New book about Common Lisp: Let Over Lambda
    ... I have read every lisp book I've been able to get my hands on ... Lisp macros are not given nearly enough ... I personally consider Let Over Lambda to be an unofficial sequel ... integral parts of the language. ...
    (comp.lang.lisp)
  • Re: LISPPA
    ... > which describes the unification algorithm in Scheme. ... But let's get back to why I think lisp is superior ... optimization macros or reader ... cases where a running program cannot continue running, ...
    (comp.lang.lisp)
  • Re: Macro functionality at runtime?
    ... we don't know what the subtree is yet. ... "Returns a list of tokens matched to subtree. ... > be optimized out by the lisp compiler. ... >> If we have first class macros, ...
    (comp.lang.lisp)
  • Re: What is the main advantage of macros over functions?
    ... if one is allergic to reading Lambda one may better not use ... Lisp authors, doesn't help you much, I'd say. ... >> Readmacros are a completely different mechanism. ... Macros and Readmacros ...
    (comp.lang.lisp)