[racket] the type of range

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Jul 15 21:45:57 EDT 2014

Shouldn't random testing have found at least some of these?

Robby

On Tue, Jul 15, 2014 at 8:37 PM, Alexander D. Knauth
<alexander at knauth.org> wrote:
> The type of range is this:
>> (case->
>>  (-> Nonpositive-Integer Null)
> Why isn’t this (-> Nonpositive-Real Null) ?
>>  (-> One (List One))
> This is wrong, because (range 1) produces ‘(0), not ‘(1).
> It should be (-> One (List Zero)).
>>  (-> Byte (Listof Byte))
>>  (-> Index (Listof Index))
>>  (-> Fixnum (Listof Fixnum))
> Why isn’t this (-> Fixnum (Listof Nonnegative-Fixnum)) ?
> And why isn’t there a (-> Integer (Listof Nonnegative-Integer)) case in here?
>>  (-> Real (Listof Integer))
> Why isn’t this (-> Real (Listof Nonnegative-Integer)) ?
>
>>  (->* (Positive-Integer Byte) (Integer) (Listof Positive-Byte))
>>  (->* (Nonnegative-Integer Byte) (Integer) (Listof Byte))
>>  (->* (Positive-Integer Index) (Integer) (Listof Positive-Index))
>>  (->* (Nonnegative-Integer Index) (Integer) (Listof Index))
>>  (->* (Nonnegative-Integer Nonnegative-Fixnum)
>>       (Integer)
>>       (Listof Nonnegative-Fixnum))
>>  (->* (Positive-Integer Fixnum) (Nonnegative-Integer) (Listof Positive-Fixnum))
>>  (->* (Nonnegative-Integer Fixnum)
>>       (Nonnegative-Integer)
>>       (Listof Nonnegative-Fixnum))
>>  (->* (Nonnegative-Integer Nonnegative-Integer)
>>       (Integer)
>>       (Listof Nonnegative-Integer))
>>  (->* (Positive-Integer Integer)
>>       (Nonnegative-Integer)
>>       (Listof Positive-Integer))
>>  (->* (Nonnegative-Integer Integer)
>>       (Nonnegative-Integer)
>>       (Listof Nonnegative-Integer))
>>  (->* (Integer Real) (Integer) (Listof Integer))
>>  (->* (Exact-Rational Real) (Exact-Rational) (Listof Exact-Rational))
>>  (->* (Flonum Real) (Flonum) (Listof Flonum))
>>  (->* (Single-Flonum Real) (Single-Flonum) (Listof Single-Flonum))
>>  (->* (Inexact-Real Real) (Inexact-Real) (Listof Inexact-Real))
>>  (->* (Real Real) (Real) (Listof Real)))
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users


Posted on the users mailing list.