lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


on 1/11/08 1:47 PM, Javier Guerra at javier@guerrag.com wrote:

> On 1/11/08, Mark Hamburg <mhamburg@adobe.com> wrote:
>> In the discussion of the utility of macros, I got thinking about Ruby which
>> seems to get by without them. My Ruby is weak, so I'm going to write
>> examples in pseudo-Lua.
>> 
>> A class definition in Ruby essentially sets up an execution context in which
>> other code then can add methods or make other alterations. For example:
> 
> i might be a little dense today (it's friday afternoon after all...);
> but i don't see why you start with 'maybe we don't need macros' and go
> on with classess...

Sorry I wasn't clear.

The downside to macros is that they can rapidly cause a language to diverge
with a variety of competing syntax changes. Presumably we add macros to get
greater expressivity, so I wondered whether there were big wins available
without introducing all that a macro system can lead to.

Ruby arguably does better than Lua on syntactic convenience. Rails works in
part because Ruby makes it easy to express the sort of constructs that it
does. So, my investigation more or less evolved into "what would Ruby
constructs look like with a more Lua-ish syntax" and "what would one have to
do to Lua to support this".

Mark