lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
But there is not an equivalent lua_rawsetfield(). Is there something I
have overlooked, or is this just an oversight?


Neither one nor the other. There is no "lua_rawsetfield", but this
is not an oversight. Some people may need lua_geti (no raw version);
others may need a lua_getfieldl where the key is given as a string
with explicit length (and of course some will need a lua_rawgetfieldl
too). There are endless variations. Lua provides a few variations
for the cases we feel are more common.

But the decision was made to provide the particular variant of lua_setfield(), which is extremely useful. And since the "raw" variants add a useful (and sometimes critical) optimization of their own, it seems that the equivalent lua_rawsetfield() would have been a good choice.

I guess I'll do a patch :-)

--
chris marrin                ,""$,
chris@marrin.com          b`    $                             ,,.
                        mP     b'                            , 1$'
        ,.`           ,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"'