lua-users home
lua-l archive

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


Just to be sure, the meta-table for the package is where you would put the packages cleanup function so that
pack1 = nil
would do the right thing.  Is that right?

Looks like a good start.

Russ

On Thursday, August 22, 2002, at 01:43 PM, Roberto Ierusalimschy wrote:

I have put in the wiki an embryonic proposal for a package system for
Lua 5.0. (http://lua-users.org/wiki/PackageSystem). It is a subset
of a mix between Perl and Python systems ;-)

   use "pack1"

loads file pack1 into a new "namespace" pack1, so that you can call
functions defined there as "pack1.foo()".

  use "pack1" {import="*"}

does the same, but also polutes your own namespace with all global
names defined in pack1.

  use "pack1" {import={"foo", "goo"}}

defines only "foo" and "goo" into your namespace (you can still call
the other functions with a full name, "pack1.other()").

  use "pack1" {version=1.4}

should do something meaningful, but doesn't (currently).

-- Roberto