lua-users home
lua-l archive

Re: Numeric for loop with rationals

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


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.
-- Martin
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). :( (We also don't have a __key mechanism to gracefully degrade objects into interned table keys, so indexing with rationals is also painful... No, you still don't need to expose the "hash" or "BTree" implementation details to the user.)
--
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.

AltStyle によって変換されたページ (->オリジナル) /