lua-users home
lua-l archive

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

On Thu, Jan 26, 2017 at 5:50 AM, Charles Heywood <> wrote:
Is there a rawtype() planned to act as previous versions of type() would?

On Tue, Jan 24, 2017, 18:38 Daurnimator <> wrote:
On 25 January 2017 at 11:02, Rena <> wrote:
> On Jan 24, 2017 8:12 AM, "Luiz Henrique de Figueiredo"
> <> wrote:
>> > Is there a tentative release date for 5.3.4 or will there be an rc4
>> > before the final release?
>> It does seem plausible that there will only be an rc4 if some
>> problem with 5.3.3 is reported in the next six days or so.
> Exactly. Now is the time to report glitches.
> I've been using it since last night, no issues so far. It definitely fixed
> the coroutine resume bug in previous versions. (I thought the frequent
> crashes were the host app's fault, but since updating Lua, it's totally
> stable.)

I have been using this -rc for the last week. No issues to report.

And I'm really enjoying the __name in tostring() output!

Instead of introducing new function "rawtype()",
good old "type()" may return two values: raw type and "specialized" type:

local t = setmetatable({}, {__name = "MyType"})
print(type({}))  --> "table"
print(type(t))  --> "table", "MyType"

BTW, this way "math.type()" could be removed as it does not needed anymore:

print(type(42))  -->  "number", "integer"
print(type(3.14))  -->  "number", "float"