From caf7bdd3636f4ac5b69c803b933fd5f97af3f9c8 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 13 Aug 2008 18:51:03 +0000 Subject: [PATCH] fix descripting of struct-field-index (PR 9685) svn: r11223 --- collects/scribblings/reference/define-struct.scrbl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/collects/scribblings/reference/define-struct.scrbl b/collects/scribblings/reference/define-struct.scrbl index 1882567419..5f94b579b3 100644 --- a/collects/scribblings/reference/define-struct.scrbl +++ b/collects/scribblings/reference/define-struct.scrbl @@ -106,8 +106,7 @@ multiple times, attaches a property value to the structure type; see @margin-note{Use the @scheme[prop:procedure] to property implement an @as-index{applicable structure}, use @scheme[prop:evt] to create a structure type whose instances are @tech{synchronizable events}, and -so on. By convention, property names usually start with -@schemeidfont{prop:}.} +so on. By convention, property names start with @schemeidfont{prop:}.} The @scheme[#:prefab] option obtains a @techlink{prefab} (pre-defined, globally shared) structure type, as opposed to creating a new @@ -162,11 +161,14 @@ cp This form can only appear as an expression within a @scheme[define-struct] form; normally, it is used with @scheme[#:property], especially for a property like -@scheme[prop:procedure]. The result of +@scheme[prop:procedure]. The result of a @scheme[struct-field-index] +expression is an exact, non-negative integer that corresponds to the +position within the structure declaration of the field named by +@scheme[field-id]. @defexamples[ #:eval posn-eval -(define-struct mood-procedure ([base] rating) +(define-struct mood-procedure (base rating) #:property prop:procedure (struct-field-index base)) (define happy+ (make-mood-procedure add1 10)) (happy+ 2)