Add note about optimizing structs to the TR docs.

original commit: 1cf57b893c2cd863cc40a3d9fc6d1ced0b598436
This commit is contained in:
Vincent St-Amour 2011-06-14 16:30:43 -04:00
parent 51275863c0
commit bdd8420389

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.