[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Are automatic coercions ever going away?
- From: Coda Highland <chighland@...>
- Date: Fri, 1 Aug 2014 09:09:57 -0700
On Fri, Aug 1, 2014 at 8:50 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2014-08-01 17:36 GMT+02:00 Coroutines <coroutines@gmail.com>:
>
>> I have trouble taking the whole 'coercion in lua is bad' thing anyway.
>> It's not like Javascript where you can concatenate and add two things
>> together with the same operator (+). I am never confused about this
>> in Lua as + will derive numbers, and .. will derive strings. There is
>> no overlap for operator use. I don't find these "coercion sites" very
>> ambiguous even if metamethods are called from left-to-right on
>> availability. I'm just tired of people who hate coercion in every
>> language speaking like they know what's best for Lua from an
>> ideological pedestal.
>
> Personally, I _love_ coercion and would love to have __tostring
> invoked automatically by table.concat.
I love explicit coercion. table.concat is explicit by virtue of being
a string method. :P
/s/ Adam