lua-users home
lua-l archive

Re: Ternary operator patch

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


On Thu, Sep 16, 2010 at 1:27 AM, Henk Boom <henk@henk.ca> wrote:
>> Are there any gotchas with the new method that are likely to arise in
>> practice?
>
> Off the top of my head:
>
> foo(bar)
> ("string literal"):baz()
>
> Could be useful in either interpretation (assuming you've given the
> string's metatable something useful to call as a statement)
Hmm, could happen with other metatables too, which is perhaps a bit
more dangerous...
E.g., if X and Y are vectors (like in graphics);
 X = compute_x ()
 Y = compute_y ()
 (X-Y):lineto ()
Boom!
Hmm, that actually does seem like a problem ...
-Miles
-- 
Cat is power.  Cat is peace.

AltStyle によって変換されたページ (->オリジナル) /