[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.4 (rc3) now available
- From: nobody <nobody+lua-list@...>
- Date: Fri, 27 Jan 2017 20:17:54 +0100
On 2017-01-27 10:22, Thijs Schreijer wrote:
> You’re always getting the `__name` field, shouldn't this only be done
> if the original type is one that allows for individual meta-tables?
> eg. not calling it on a `string`, but only on `table` and `userdata`
> types?
Well, it's just a very quick experiment to get a rough estimate of the
impact on speed. (And I already don't like the effect... more checks,
calling extra functions, ... would only make it slower.) I didn't
bother to think about whether this is actually useful in all cases.
Aside from that, it's natural for me to use metatables on primitive
types. Makes for shorter code - no need to special-case or wrap
primitives (unless you need comparison operators). So just always
returning __name if available seemed logical in some way.
-- nobody
- References:
- [ANN] Lua 5.3.4 (rc3) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.3.4 (rc3) now available, Marc Balmer
- Re: [ANN] Lua 5.3.4 (rc3) now available, Dirk Laurie
- Re: [ANN] Lua 5.3.4 (rc3) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.3.4 (rc3) now available, Rena
- Re: [ANN] Lua 5.3.4 (rc3) now available, Daurnimator
- Re: [ANN] Lua 5.3.4 (rc3) now available, Charles Heywood
- Re: [ANN] Lua 5.3.4 (rc3) now available, Egor Skriptunoff
- Re: [ANN] Lua 5.3.4 (rc3) now available, nobody
- Re: [ANN] Lua 5.3.4 (rc3) now available, Thijs Schreijer