lua-users home
lua-l archive

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


On Fri, Jan 28, 2011 at 06:52, Tony Finch <dot@dotat.at> wrote:
> On Fri, 28 Jan 2011, joao lobato wrote:
>>
>> What about the case when wants to discover the method name at runtime:
>
> It may be worth allowing obj:[method](args)
>
>> I guess I got a bit philosophical, my point is that, in my opinion, if
>> one mixes container data with methods, it looks like bad design.
>
> Yes. I would like it to be easier and more efficient to do that.
>
> Tony.
> --
> f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
> HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7,
> DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR
> ROUGH. RAIN THEN FAIR. GOOD.
>
>

I've often wondered why I can do:
foo.bar:baz(4) --> foo.bar.baz(foo.bar, 4)
but not:
foo:bar.baz(4) --> foo.bar.baz(foo, 4)
or perhaps even:
foo:bar:baz(4) --> foo.bar.baz(foo, foo.bar, 4)
(although to be honest I can't think of a lot of uses for that last
one; just a random thought.)

-- 
Sent from my toaster.