I want to write this:

(for/list ([b (in-range 256)])
  b)

... and get back a list of bytes.

That is, I want TR to see that the number 256 is one greater than the
largest byte, and therefore that b must be of type byte.  I see that this
dips way too close to undecidability in the general case, so I would
instead perhaps expect to see something like an 'in-bytes-range' form that
is known to produce only bytes.

I looked for such a thing, but didn't find it.  Naturally, I could simply
jam a run-time check in at the top of the body, something like
'ensure-bytes', but it seems unnecessary.

Am I missing something obvious?

Thanks!

John
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to