lua-users home
lua-l archive

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


On Wed, Apr 9, 2014 at 11:32 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> It works, but ... just for entertainment value, you know ;)  (Easy to
> port to 5.2)

This is a more bullet-proof version:

https://gist.github.com/stevedonovan/10259826

require 'from'
local sin,cos,tan = slots(3) from(math)
local import,printf = slots(2) from 'pl.utils'
local pretty,utils,xml = slots(3) from 'pl.*'

The last form is possibly overkill but in general, modules live in
packages and any proposal needs to address this fact.

caveat: the debug library is used and can be slow - only use for
top-level declarations.