[racket] Typed Racket: (Parameterof (HashTable ...))

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Sat Feb 15 15:19:05 EST 2014

On 2014-02-15 14:31:51 -0500, Greg Hendershott wrote:
> And as someone whose predominant static typing experience is C and
> C++, I have the instinct that you don't cast unless you know exactly
> what you're doing. So when I need to use `ann` or `cast` or `assert`,
> I wince. But I'm still trying to learn the appropriate instinct, here.

With Typed Racket, it's always okay to put in more `ann`s to help the
typechecker. "Okay" in the sense that if you put in wrong `ann`s you
will find out at compile-time.

Unlike C, it's also always safe to use `cast` or `assert`. "Safe" in the
sense that if there's a type mismatch you will get a run-time error at
worst. You won't get undefined behavior or segfaults.

(except if you accidentally stumble on a bug in the type system)


Posted on the users mailing list.