[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Are automatic coercions ever going away?
- From: Steven Degutis <sbdegutis@...>
- Date: Fri, 1 Aug 2014 15:05:50 -0500
I have indeed found times where I wasn't sure every value in a table
was a string when I needed to run it through table.concat. But other
times I already knew they were strings, so running tostring() on them
within table.concat would have just been a waste of CPU.
On Fri, Aug 1, 2014 at 3:01 PM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Coroutines once stated:
>> On Fri, Aug 1, 2014 at 8:50 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>>
>> > Personally, I _love_ coercion and would love to have __tostring
>> > invoked automatically by table.concat.
>>
>> I still like the idea of having a debug.raw() to call a function
>> inside where no metamethods are triggered -- sort of an enclosed
>> meta-less scope. The default would be triggering everything if
>> available, and letting the chips fall where they meta-may :p
>>
>> You and me both on the table.concat()
>
> Coercion for table.concat() seems reasonable, since it's there to produce
> a string. Another coersion I would like is "%s" in string.format()---again,
> it's clear you want a string in that position, so convert that argument to a
> string.
>
> -spc
>
>