Re: is #f a valid index? Duy Nguyen 30 Jun 2020 09:51 UTC

On Tue, Jun 30, 2020 at 4:47 PM Marc Nieper-Wißkirchen
<xxxxxx@nieper-wisskirchen.de> wrote:
>
> Am Di., 30. Juni 2020 um 11:42 Uhr schrieb Duy Nguyen <xxxxxx@gmail.com>:
>
> > You could do it, you just need to box the index in a separate type.
> > This is how it's done in Gauche, which stores byte offset most of the
> > time (but with a separate tag, so it's distinct from integers)
>
> I meant a raw unboxed fixnum.

I figured as much, but why would you want that? Index-as-fixnum is
returned by plenty other functions, using fixnum for byte offset just
opens more opportunity of using a fixnum for a wrong purpose. Plus
byte offset is not useful in scheme anyway, you can't access any
character with a byte offset unless you go through a horrible process
of converting a string to u8vector or something.
--
Duy