lua-users home
lua-l archive

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


Gavin Wraith wrote:

In message <d010fc8a05051907081d63f5a6@mail.gmail.com> you wrote:


I for one think the length operator is a good thing.
The frequency of use justifies the syntactic simplification.


I agree, and my vote would be for # rather than *. There is an
aesthetic rationale for my choice. # looks like two overlaid +
signs and length is additive. * makes me think of multiplication,
not appropriate at all.


I am a newbie here, so forgive my impertinence. But lua has typically chosen keywords for readability (do end vs do { }). I have used lots of programming languages, but I have never used one where a length operator was done with a symbolic primitive. Doesn't "t:len()" or even table.len(t) seem like better syntax? And what does this primitive return anyway, the real length of the table or what luaL_getn() returns?

--
chris marrin                ,""$,
cmarrin@arch.sel.sony.com b`    $                             ,,.
(408) 955-3049          mP     b'                            , 1$'
Sony    ,.`           ,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"'