lua-users home
lua-l archive

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

Rici Lake wrote:

- CodeSnippetThree: It looks like you leave a value on the stack. Is that intended?

Where, exactly?

Both of these were abstracted out of a more complex binding library, so I haven't actually tried them. I'll try to post the real code (which actually works, I think) later today.

Sorry, that was my mistake.

After reading all this I am still confused about what the environment table in a userdata does. Is it just a place to store a table that can be retrieved and manipulated, or does it actually come to play in some API calls somewhere? As I mentioned, I don't see it being used anywhere in the 5.1 API. Sorry about being dense, but I really think this will solve a lot of problems for me, so I really want to understand it well.

Me, too. :)

Hmmm. Are you saying that you don't know why userdatas have an environment? (it would me feel better if so :-)

I thought I would understand it better if I read the VM doc to see what the various GET and SET opcodes did. But in looking at the code for these in lvm.c it still looks like the only environment that ever gets used is the one in the currently running function.

chris marrin                ,""$,          b`    $                             ,,.
(650) 941-9040          mP     b'                            , 1$'
M1      ,.`           ,b`    ,`                              :$$'
     ,|`             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`
"As a general rule,don't solve puzzles that open portals to Hell"'