Re: Listcomprehension-macro? Macros with args inside macro-name?



defn noob wrote:

I am trying to learn lisp macros and I generally find
listcomprehensions to be elegant and they dont exist in lisp.
This has to be a macro right? Cant be a function?

Yes, it has to be a macro, if you need it fast and if you want your own
syntax, like used for list comprehensions in other languages like Haskell.
A nice example is this one, which was presented at ILC2007:

http://www.iro.umontreal.ca/~latendre/publications/listCompFinal.pdf

Maybe you should take a look at Liskell, too. Liskell is a new Lisp syntax
frontend for Haskell, so I assume it implements list comprehensions and it
might help to find a good Lisp-like syntax.

--
Frank Buss, fb@xxxxxxxxxxxxx
http://www.frank-buss.de, http://www.it4-systems.de
.



Relevant Pages

  • Re: Why is LISP syntax superior?
    ... that lisp was the most powerful programming language ever invented, ... It is precisely the lack of syntax that I admire in Lisp ... (setf (elt seq i) ... I guess one could write a reader macro to transform foointo (elt ...
    (comp.lang.lisp)
  • Re: eval in bash vs macro in lisp
    ... So although I don't understand LISP macros, ... features to the language. ... 'for' loop in Common Lisp using a macro. ... the syntax of the language. ...
    (comp.lang.lisp)
  • Re: eval in bash vs macro in lisp
    ... So although I don't understand LISP macros, ... features to the language. ... 'for' loop in Common Lisp using a macro. ... the syntax of the language. ...
    (comp.lang.lisp)
  • Re: Reasons for preferring Lisp, and for what
    ... There are so many reasons to prefer Lisp, ... > components, can be built into yet higher-level abstractions, in a way ... The syntax *is* superior to nested function calls. ... Consider a typical cpp macro that incorporates multiple C statements. ...
    (comp.lang.lisp)
  • Re: Cons cell archaic!?
    ... How would the implementation of a Lisp without a using cons look like? ... the irregularity in its often cited regular syntax. ... Lisp at core is based on functional programing on lists. ...
    (comp.lang.lisp)