> On Jun 29, 2017, at 17:33, Zelphir Kaltstahl <zelphirkaltst...@gmail.com> > wrote: > > A while ago I started looking at Typed Racket and today I took a look again. > > The documentation says: > >> Typed Racket provides modified versions of core Racket forms, which permit >> type annotations. Previous versions of Typed Racket provided these with a : >> suffix, but these are now only included as legacy forms for backwards >> compatibility. > > To me this sounds as if I am not supposed to use them anymore. So I tried the > following, which works: > > ~~~ > racket -I typed/racket > > (let ([x 7.0]) > (ann x Positive-Flonum) > x) > ~~~ > > So I could use `ann` instead, but is it not as short as the colon notation. > Then I also discovered: > > ~~~ > (let ([x 7.0]) > (: x Positive-Flonum) > x) > ~~~ > > Which also works. It is not a change in a core form, so I guess this is not > part of the stuff kept for backward compatibility (?). > > I'd like to know what the best practice of writing type annotations is. The > guide in the documentation still uses a lot of the changed core forms, which > is my impression are not recommended, since they're only kept for backwards > compatibility, so one should not rely on them.
I believe this text is referring to forms such as for: and lambda: — that is, syntactic terms where the lambda is attached to the identifier. I believe this text is *not* referring to the use of the colon as a simple “has-type” form. John -- 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.