On Jan 7, 2012 2:24 AM, "John Clements" <cleme...@brinckerhoff.org> wrote: > > > On Jan 5, 2012, at 5:32 PM, Sam Tobin-Hochstadt wrote: > > > On Thu, Jan 5, 2012 at 11:56 PM, John Clements > > <cleme...@brinckerhoff.org> wrote: > >> 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? > > > > You're correct about the scope, and the fact that you wrote it without > > thinking, and it just did the right thing, is precisely what I was > > going for. What's fragile here? > > Okay, yes, it makes sense. The scope is not defined by a pair of parentheses, but I guess I can get past that; after all, our internal defines are headed in that direction, too.
I would say that the scope is defined by a *different* pair of parentheses . Sam
____________________ Racket Users list: http://lists.racket-lang.org/users