lua-users home
lua-l archive

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


2011/10/20 Tony Finch <dot@dotat.at>:
> [...]
>
>  -- syntactic sugar for require
>
>  library = setmetatable(package.loaded, {
>              __index = function (_, name)
>                          return require(name)
>                        end
>            })
>
>  -- get math and io modules from the library
>
>  local math, io <- library

That proposal is smart, and very refreshing. Whatever the outcome, I
believe that's good food for thoughts :-)

As I personnally prefer keywords to symbols (in the context of Lua at
least), I'd rather have "from" be used instead of "<-" (since that's
how you read, why not write it that way?).

Injection on the other hand sounds less useful, and at the same time I
can't think of a good keyword to put in the place of your syringe
operator. A very bad one would be "sucks" (I'm not a native english
speaker and I can't find a better synonym):

   tbl -< foo, bar, zig

becomes

   tbl sucks foo, bar, zig -- from the globals