Re: Restriction on integer indices
D Guthrie 05 Nov 2026 17:14 UTC
Hi Peter,
> On 1 Nov 2026, at 12:21, Peter McGoron <xxxxxx@mcgoron.com> wrote:
>
> The SRFI restricts node indices to be non-negative integers.
>
> 1. Is there a reason that the type can't/shouldn't be implemented allowing negative integers? SRFI 224 (integer mappings) allows negative integers as keys, for example
I assumed that SRFI 224 doesn't admit negative integers as keys. The reason I assumed this is that this is one of the suggested optimisations in the original workshop paper for the integer maps (which I read when I was implementing these in Julia a few months ago). So I think I was simply mistaken. I'll correct this in the next draft, so thanks.
> 2. What is the allowed range of indices? Is an implementation allowed to limit the indicies to the maximum fixnum (2^24, or ≈16.8 million nodes)?
The check I made in the sample implementation was that a given index is a fixnum and that it is nonnegative, so that's implicitly the maxmimum fixnum.
Thanks,
Duncan