Add note about optimizing structs to the TR docs.

This commit is contained in:
Vincent St-Amour 2011-06-14 16:30:43 -04:00
parent e3274a3cf7
commit 1cf57b893c

View File

@ -154,3 +154,8 @@ fashion as @racket[car] and @racket[cdr].
(vector-ref x color-name) ; good
(vector-ref x (* 0 10)) ; bad
)
In many such cases, however, @seclink[#:doc '(lib
"scribblings/guide/guide.scrbl") "define-struct"]{structs} are
preferable to vectors. Typed Racket can optimize struct access in all
cases.