Edward Faulkner <ef / alum.mit.edu> wrote: > On Wed, Sep 28, 2005 at 12:26:42AM +0900, Robert Klemme wrote: > > Maybe I missed something in the discussion but I still wonder what would > > be gained by having Lisp macro like capabilities in Ruby (apart from the > > fun that it'd certainly be for some of us)? Do we actually gain > > something? Is there something that we cannot do in Ruby without this > > feature and that will become utterly easy with it? > > Lisp macros are essentially a technique for metaprogramming. Ruby > already has its own metaprogramming techniques. I suspect almost > anything you can do with one you can do with the other. > > But they take very different approaches. Lisp enables metaprogramming > by making the full power of the language available at compile time. > Ruby enables metaprogramming by eliminating the distinction between > compile time and run time. > > (Note that Lisp can be run interpreted too. Compilation in that case > happens just before each evaluation.) I believe early versions were actually interpreted only and you definitely can have a Lisp interpreter that does no compilation (you wouldn't want it for speed reasons but it's perfectly feasible). I still don't view Lisp as a compiled language. As far as I understand the language the runtime must contain a compiler if you want compiled code. To me this is a definite hint that compilation is rather an optimization technique than a feature of the language (as opposed to C etc.). Am I wrong here? > Personally, I think the Lisp way is more elegant, and it has more > opportunities for optimization. But I think it would be a mistake to > try to graft it onto Ruby. It doesn't match with Ruby's style and > philosophy. That pretty much covers what I suspected. Kind regards robert