From 1cf57b893c2cd863cc40a3d9fc6d1ced0b598436 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Tue, 14 Jun 2011 16:30:43 -0400 Subject: [PATCH] Add note about optimizing structs to the TR docs. --- collects/typed-scheme/scribblings/guide/optimization.scrbl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/collects/typed-scheme/scribblings/guide/optimization.scrbl b/collects/typed-scheme/scribblings/guide/optimization.scrbl index 9b8d4a65fb..c69c6f4416 100644 --- a/collects/typed-scheme/scribblings/guide/optimization.scrbl +++ b/collects/typed-scheme/scribblings/guide/optimization.scrbl @@ -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.