Hello, looking at vector-length[1] documentation, it returns (exact-nonnegative-integer?). However, as far as I can tell, it returns (fixnum?). Also for subsequent contracts in the vector's documentation all indices are assumed to be (exact-nonnegative-integer?) but usually it is impossible on given platform to use anything larger than (fixnum?) in reality.
For example on 64bit platforms the (fixnum?) could store numbers from (- (expt 2 62)) to (sub1 (expt 2 62)). Vector slots cannot be smaller than 64bits (machine-dependent pointers) which means 8 bytes = 3 bits of address. Given 64bit (VERY theoretical) size of the address space, this leaves the possibility of storing a single vector with (expt 2 61) elements into the memory. If I did not overlook anything, the contracts could be safely changed to (fixnum?). And yes, I found this issue while cleaning up my futures-sort[2] package discussed a few months ago here. If I assume (exact-nonnegative-integer?), I need to manually check for (fixnum?). Even though it - given the information above - does not really make much sense. Should I open a PR? Cheers, Dominik [1] https://docs.racket-lang.org/reference/vectors.html#(def._((quote._~23~25kernel)._vector-length)) [2] https://docs.racket-lang.org/futures-sort/index.html -- 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/e9ea30ad-5563-fe1a-688c-73fe47b51e68%40trustica.cz.