lua-users home
lua-l archive

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


On Fri, Jun 12, 2015 at 2:04 PM, Brigham Toskin <brighamtoskin@gmail.com> wrote:
> Don't forget we would end up with very ruby-like method chaining, for
> methods that don't require any additional args...
>
>>
>> monster:selectpartymember:takedamagewithresistance(monster:selectspell:randomdamageval)
>
> I'm not arguing the merit of this one way or the other; just pointing out
> it's a consequence for calling methods like this.
>

That can be nice when you have more reasonable method names :-)

command = input:urldecode():lower():trim():split(' ')

As for metamethods, you can think of a.b and a[b] as always being a
call; if a doesn't have __index metamethod then it's a call to a
"hidden" built-in function.

-- 
Sent from my Game Boy.