[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Definition of a sequence
- From: Andrew Starks <andrew.starks@...>
- Date: Fri, 5 Jun 2015 13:50:55 -0500
On Fri, Jun 5, 2015 at 9:23 AM, Jonathan Goble <jcgoble3@gmail.com> wrote:
> Also, using a float for a date actually makes sense somewhat, as it
> allows easy sorting of the dates, as well as arithmetic with a little
> work. For example, he could easily subtract one date float from
> another to test whether X year(s) have passed between the dates. (But
> I'm getting too far off of the topic, so I'll stop there.)
If Lua always stored all numeric keys in order, then there might be
more opportunities to dream up efficient iterators, like a sort of
`npairs`. I think I'm different, because i need to index values by
arbitrary numbers (and need them in order) quite often, whereas
everyone else is concerned only with sequences and their strict
definition.
Returning an ordinal set of numbers (with holes and / or floats) is
currently accomplished by programming in Lua. :) I'm guessing that
this is too narrow of a use case to compel a change.
-Andrew