lua-users home
lua-l archive

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

El 17/09/2004, a las 13:33, Asko Kauppi escribió:

I think making '_' work like a /dev/null in variable land would be a Great Thing.

I don't know wether it's a Great Thing (tm), but it is at least a Godd Thing (tm)! I always see the underscore as a kitchen-sink variable. This comes from functional languages like OCaml, that use underscores just that way. Moreover, if you recognize "_" as such, you can make optimizations to bytecodes, for example if you do:

    _, a = my_function()

The compiler may skip generating bytecodes for the first argument, thus gaining a bit in speed. Not a big gain, but it worths if you use "_" a lot (using "_" is quite usual in functional programming).


Attachment: PGP.sig
Description: Mensaje firmado digitalmente