[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1 (work6) now available
- From: David Burgess <dburgess@...>
- Date: Fri, 20 May 2005 00:08:51 +1000
I for one think the length operator is a good thing.
The frequency of use justifies the syntactic simplification.
DB
On 5/19/05, Chris Marrin <chris@marrin.com> wrote:
> Adriano Ferreira wrote:
> > Each one of these operators or prefixes (* or #) has its load of
> > meanings in another programming languages. It is difficult to chose
> > which one makes more sense in the context of Lua.
> >
> > For example,
> > * (C/C++)
> > - dereferencing pointers in expressions
> > - declaring pointer types in declarations
> > * (Ruby, Python, Perl6)
> > - syntactic sugar for what Lua unpack does: f(*p) = f(p[0], p[1], ...)
> > In Perl 6 known as the splat operator
> > # (Smalltalk)
> > - used as a prefix for Symbols (which are Smalltalk parlance for
> > Lisp/Scheme atoms)
>
> But why have a primitive operator for this at all? It seems like having
> a library function call to return this information would be sufficient.
> In fact, Lua has such a thing, or more precisely it has two, right? One
> to return the number of contiguous numeric indices and one to return the
> total number of properties. So why the operator? I think adding modulus
> '%' is a good idea because this is such a fundamental operator. But if
> you want to add new operators, then the bitwise operators or '+=', etc.
> would seem like a better choice, wouldn't it?
>
> --
> 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"'
>