lua-users home
lua-l archive

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


Javier Guerra wrote:
On Tuesday 16 August 2005 5:27 pm, Chris Marrin wrote:

Does it have to be done at compile time? Couldn't the import function
simply iterate over all the members of math and put them in the local
namespace? Or is that not possible somehow?


i think locals, like fuction parameters, have no run-time names; only numbered slots


I am using the wrong term. When I say "locals" I mean properties of the "local namespace", which is the environment being used by a particular function. So, if I have module 'a' and I want to import some or all of its properties into the environment of a function, I would just copy the property references from the module to the environment. They are both just tables, right?

--
chris marrin              ,""$, "As a general rule,don't solve puzzles
chris@marrin.com        b`    $  that open portals to Hell" ,,.
        ,.`           ,b`    ,`                            , 1$'
     ,|`             mP    ,`                              :$$'     ,mm
   ,b"              b"   ,`            ,mm      m$$    ,m         ,`P$$
  m$`             ,b`  .` ,mm        ,'|$P   ,|"1$`  ,b$P       ,`  :$1
 b$`             ,$: :,`` |$$      ,`   $$` ,|` ,$$,,`"$$     .`    :$|
b$|            _m$`,:`    :$1   ,`     ,$Pm|`    `    :$$,..;"'     |$:
P$b,      _;b$$b$1"       |$$ ,`      ,$$"             ``'          $$
 ```"```'"    `"`         `""`        ""`                          ,P`