What if we had a `(vector-index/c vec)` contract combinator? It would be 
equivalent to `(integer-in 0 (sub1 (vector-length vec)))`.

On Wednesday, December 4, 2019 at 1:29:22 PM UTC-8, Matthew Flatt wrote:
>
> At Wed, 4 Dec 2019 22:24:10 +0100, Dominik Pantůček wrote: 
> > What about all the vector-ref, -set! and basically all indices 
> > contracts? That should probably be the same. 
>
> I'm less enthusiastic about that change. It turns out that a non-fixnum 
> argument won't work for `vector-ref`, but the stronger constraint is 
> that the argument needs to be less than the vector's length. So, it 
> seems redundant in an unhelpful way to require that the argument 
> individually is a fixnum --- but I'm not completely sure. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6bf86e11-ca19-4619-845c-98b0478a7ebc%40googlegroups.com.

Reply via email to