The example in the documentation for using #:result with for/fold, here: 
works in normal racket, but not typed racket.

I suppose that isn't really a bug, but something simply left out, and a 
user can simply implement the macro themselves?

Additionally, regarding occurrence typing:

This works:

> (for ([x (in-list '("123" "432" "234"))])
    (define num (string->number x))
    (unless num
      (error "Not a number"))
    (display (format "~s" (* num 2))))

But this doesn't typecheck:

> (for ([x (in-list '("123" "432" "234"))])
    (define num (string->number x))
    (unless num
      (error "Not a number"))
    (define double (* num 2))
    (display (format "~s" double)))
. Type Checker: type mismatch
  expected: Number
  given: (U Complex False) in: num

Am I missing something here?

I'm running the code in DrRacket, using v7.1.


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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to