lua-users home
lua-l archive

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



On Fri, Jan 31, 2014 at 6:33 AM, Fabien <fleutot+lua@gmail.com> wrote:

print("hello %s" % { "world" }).

Hmmm.... dangit!

I like this better. Except for that it uses a table, but this is sweet. The extra parens kind of kill the syntactic beauty of the __call method. If not for that, it'd win in my book.

Other experiments I want to play around with are[1]:

1: Impregnate the table with the Lpeg library. I'm not sure about the sorts of mayhem this would lead to, but it sounds fun.

2: something like ("howdy")["ow"] or ("howdy")["2|"] or whatever... I don't know how python does it, but I'm sure that stealing from there would be wise.

-Andrew

[1] I wonder if discovering that there is a string metatable and that you can play with it is a common rite of passage amongst people who journey through lua...