lua-users home
lua-l archive

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




On 2018-01-29 09:57 PM, dyngeccetor8 wrote:
On 01/30/2018 02:16 AM, Soni "They/Them" L. wrote:
On 2018-01-29 09:00 PM, dyngeccetor8 wrote:
On 01/29/2018 04:52 AM, Soni "They/Them" L. wrote:
I can't get `for x=r(1, 10), r(10, 10), r(1, 10) do print(x) end` to work.
Me too.
It errors that they aren't numbers. Ofc they aren't Lua numbers, they're custom
numbers.

It saddens me that Lua doesn't support custom numbers as well as other languages
(namely Python). :(
Because it's numeric "for".

There is generic "for" for iterating other things.

-- Martin

Please don't post xkcds without (at the least) a link to the source. It's a violation of the xkcd license https://xkcd.com/license.html

Also, rationals are still numbers. They're just not "Lua numbers" (objects with type(x) == "number"). Any language with operator overloading (e.g. C++) lets me have numeric for with rationals. Except Lua. (Python doesn't have numeric for at all so it doesn't count.)

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.