[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: what to make of this fellow named __ipairs?
- From: HyperHacker <hyperhacker@...>
- Date: Fri, 28 Jan 2011 18:33:38 -0700
On Fri, Jan 28, 2011 at 06:52, Tony Finch <firstname.lastname@example.org> 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.
> f.anthony.n.finch <email@example.com> 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)
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.