On Sep 27, 2005, at 10:09 AM, Jim Freeze wrote:

> On 9/27/05, Ben <benbelly / gmail.com> wrote:
>
>> On 9/27/05, Jim Freeze <jim / freeze.org> wrote:
>>
>>>
>>> Matz has said (at the Lightweight Language Conf) that Ruby will  
>>> never
>>> have macros because they are too easily abused, by the average  
>>> person,
>>> to mutate the language.
>>>
>>>
>>
>>   This is a cop-out.  Every time a new language comes around and
>>
>
> Hmm, that is strong language. Do you think Matz has made a bad  
> decision
> here? Ruby does have lambda's. If you really need a lisp like  
> language,
> there is always Lisp. :)

I think I agree with Ben to some degree. I don't think the outcome is  
a bad one, but the reason seems like a 'cop-out'. Surely there's a  
better reason than that. Even a "I don't want to" or "I don't see  
why" or "Ruby takes a different approach" or "No" from Matz would be  
much better. Saying that it is "too dangerous" is just asking for an  
argument :-)

>
> Seriously, can you put your statement in words that define exactly
> what you mean? What exacly 'macro like' feature are you looking for?
> Are you really looking for macro capability or just a lazy eval?

Looking at macros on a feature by feature basis isn't going to work.  
Just like learning about macros by reading about what you can do with  
them isn't going to work either -- at least it didn't for me. Having  
macros like Common Lisp has changes the way you think about  
programming and how you do it -- they certainly changes the  
programmes. I really like working in both Common Lisp and Ruby. Ruby  
is very very flexible and probably can address most of the individual  
features/aspects of macros, but it cannot match macros as a concept  
because it simply doesn't have the concept. And that is okay, let  
Ruby be Ruby.

Foolishly venturing into very dangerous territory to actually address  
the question... Ruby seems to be based on a few syntactic structures  
and a whole bunch of method calls. Anybody can add methods to be  
called, so extending Ruby's 'syntax' that way is easy. Adding new  
funny syntactic structures is what macros are for. You can't do that  
in Ruby. You can in lisp. So, there would be one use for macros that  
I don't think Ruby can deal with right now.

Cheers,
Bob

>
>
> --
> Jim Freeze
>
>

----
Bob Hutchison          -- blogs at <http://www.recursive.ca/hutch/>
Recursive Design Inc.  -- <http://www.recursive.ca/>
Raconteur              -- <http://www.raconteur.info/>