[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: intra-package require
- From: Mark Hamburg <mark@...>
- Date: Fri, 5 Feb 2010 10:21:37 -0800
In a move that I would not recommend in its current form but which may be informative, let me highlight how Lightroom handles this. Note that we did this design before the package system in 5.1 and never went back and revised it.
We have essentially two functions:
* One does a global lookup/load for a name (based on package manifests) and makes it available.
* Each package has its own global environment and that environment includes a function which will do a lookup/load from within the package.
To the extent that Lua worries about encapsulation, it would be nice to have standards for saying "this is my public interface" and "this is my private component" -- e.g., a C module wrapped in a Lua interface. As things stand, that sort of encapsulation is essentially handled by convention.
Mark