Re: eval use ?



Majorinc wrote:

How do you think "code=data" can be possible without EVAL? Macros fall short here, because code=data means that code can be processed during runtime, just like data is usually processed during runtime.

code=data doesn't imply code=data at runtime. code=data at runtime doesn't imply the use of eval.

Macros take advantage of the code=data nature at compile-time (or better, macroexpansion time).

Closures are another form of code=data, in the sense that closure can be passed around as first-class values.

eval has issues that are solved by macros and closures. Your focus on eval as the only valid expression of the code=data idea is far too narrow.


Pascal

--
My website: http://p-cos.net
Closer to MOP & ContextL:
http://common-lisp.net/project/closer/
.



Relevant Pages

  • Re: The power difference between a macro and a function
    ... What extra expressive power macros give ... What's the point of being a programmer if you can't do these mechanical ... increased power lies with the language designer, ...
    (comp.lang.lisp)
  • CLAZY: lazy calling in Common Lisp
    ... In a bout of Haskell envy I did a few tricks with macros, closures and ... SYMBOL-MACROLET and added true lazy calling to CL. ...
    (comp.lang.lisp)
  • Re: in macro from ANSI Common Lisp
    ... (defmacro in (obj &rest choices) ... (dolist (clos closures NIL) ... (defmacro in (obj &rest expressions) ... Well, once you introduce macros to implement syntactic abstractions, ...
    (comp.lang.lisp)
  • Re: "Staggering power of closures..."
    ... > with macros & closures. ... Actually, I think closures are a terrible way to implement objects, ... Many of the posts you see on Usenet are actually from moths. ...
    (comp.lang.lisp)
  • Re: Yet another when to use macros question....
    ... Majorinc, Kazimir ... So it hurts when you use macros? ... An eval that _allows_ macros doesn't cost significantly over an eval ...
    (comp.lang.lisp)