lua-users home
lua-l archive

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

> import "a.b.c"
>     ==>
> local c = require "a.b.c"
> import("a.b.c", d, e, f)
>     ==>
> local c = require "a.b.c"
> local d, e, f = c.d, c.e, c.f
> Realistic examples:
> import("math", sin, cos, tan)
> import("string", sub, gsub, find, gfind)

Very very nice syntax; This is a 'fits like a glove' proposal methinks. I
vaguely remember see this as a feature of Python. Since I mentioned Python,
would allowing a regular expression to find the names to import as in:
	import("blob", "foo_*")
	import("blob", "bar_*")
make the proposal better or worse?

Can LHF's upcoming preprocessor be used to implement this feature?

Vijay Aswadhati