fix descripting of struct-field-index (PR 9685)
svn: r11223
This commit is contained in:
parent
962fea6513
commit
caf7bdd363
|
@ -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
|
@margin-note{Use the @scheme[prop:procedure] to property implement an
|
||||||
@as-index{applicable structure}, use @scheme[prop:evt] to create a
|
@as-index{applicable structure}, use @scheme[prop:evt] to create a
|
||||||
structure type whose instances are @tech{synchronizable events}, and
|
structure type whose instances are @tech{synchronizable events}, and
|
||||||
so on. By convention, property names usually start with
|
so on. By convention, property names start with @schemeidfont{prop:}.}
|
||||||
@schemeidfont{prop:}.}
|
|
||||||
|
|
||||||
The @scheme[#:prefab] option obtains a @techlink{prefab} (pre-defined,
|
The @scheme[#:prefab] option obtains a @techlink{prefab} (pre-defined,
|
||||||
globally shared) structure type, as opposed to creating a new
|
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
|
This form can only appear as an expression within a
|
||||||
@scheme[define-struct] form; normally, it is used with
|
@scheme[define-struct] form; normally, it is used with
|
||||||
@scheme[#:property], especially for a property like
|
@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[
|
@defexamples[
|
||||||
#:eval posn-eval
|
#:eval posn-eval
|
||||||
(define-struct mood-procedure ([base] rating)
|
(define-struct mood-procedure (base rating)
|
||||||
#:property prop:procedure (struct-field-index base))
|
#:property prop:procedure (struct-field-index base))
|
||||||
(define happy+ (make-mood-procedure add1 10))
|
(define happy+ (make-mood-procedure add1 10))
|
||||||
(happy+ 2)
|
(happy+ 2)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user