[racket] TR: scope of universally quantified type variables is ... very strange?

From: John Clements (clements at brinckerhoff.org)
Date: Thu Jan 5 17:56:05 EST 2012

I wrote a piece of code like this without thinking:

#lang typed/racket

(: f (All (T) (Number -> T -> T)))
(define ((f x) y)
  (ann y T))

... and then, after a second, was sort of flabbergasted that it worked.  What's the scope of the type variable T? Apparently I can use it anywhere in the definition of the identifier that it names? That seems really fragile. Am I misunderstanding this?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120105/2e3611e4/attachment.p7s>

Posted on the users mailing list.