[racket] ":" preferred to "define:"?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Wed Dec 22 12:40:11 EST 2010

On Wed, Dec 22, 2010 at 12:36 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> Why is ":" preferred to "define:", when usually you're just going to follow
> the ":" form with a "define" form?
>
> The Typed Racket Reference says:
>
>> In most cases, use of ":" is preferred to use of "define:".

Two reasons:

1. Adding `:' before the definition allows you not to change the
existing untyped definition.  This is good for diffs, for example.
2. I greatly prefer the visual appearance using `:' -- `define:'
results in lots of syntactic noise.  Similarly, I prefer Haskell-style
type annotation to ML-style in those languages.

-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.