[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Numeric for loop with rationals
- From: Paige DePol <lual@...>
- Date: Tue, 30 Jan 2018 19:25:00 -0600
Soni They/Them L. <fakedme@gmail.com> wrote:
> It would not. Integer and float are treated separately in the VM, but
> exposed as a single type.
>
> They're physically distinct TValues.
The numeric for loop is designed to work on the Lua numeric data type, there
isn't a Rational number data type, so how would you update the numeric for
loop to use them... or am I missing something in relation to your example of
"for i=r(1,10), r(10,10), r(1,10) do ... end"?
> The VM already checks if ttisinteger. Floats and ints have the same
> performance. My proposal would make floats slightly slower (one extra
> check), but it'd also fix a major issue with the current implementation
> (an integral part of a lot of exploits out there), while not affecting int
> performance at all.
Out of curiosity, what exploits are you referring to?
Would having the C style expression for loop be helpful in Lua I wonder?
~Paige
- References:
- Numeric for loop with rationals, Soni "They/Them" L.
- Re: Numeric for loop with rationals, dyngeccetor8
- Re: Numeric for loop with rationals, Soni "They/Them" L.
- Re: Numeric for loop with rationals, dyngeccetor8
- Re: Numeric for loop with rationals, Soni "They/Them" L.
- Re: Numeric for loop with rationals, Francisco Olarte
- Re: Numeric for loop with rationals, Soni "They/Them" L.
- Re: Numeric for loop with rationals, Dirk Laurie
- Re: Numeric for loop with rationals, Soni "They/Them" L.
- Re: Numeric for loop with rationals, Dirk Laurie
- Re: Numeric for loop with rationals, Soni "They/Them" L.
- Re: Numeric for loop with rationals, Charles Heywood
- Re: Numeric for loop with rationals, Soni "They/Them" L.
- Re: Numeric for loop with rationals, Tim Hill
- Re: Numeric for loop with rationals, Soni "They/Them" L.