lua-users home
lua-l archive

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


> > However there is one weak spot -- the import function. It is too easy
>  > to mess things up and write arguments in wrong order:
>  >
>  >     local foo, bar, baz = import 'path/to/file.lua' { 'bar', 'baz', 'foo' }
>
>  local Corge = require 'qux.quux.Corge'
>  local foo = Corge.foo
>  local bar = Corge.bar
>  local baz = Corge.baz

Wel, two things.

1. I prefer to avoid using require.
2. There is no validation for Corge.foo to actually exist.

Alexander.