Changeset 39530 in project


Ignore:
Timestamp:
01/26/21 14:18:07 (5 weeks ago)
Author:
sjamaan
Message:

defstruct: Clarify that the default value for slots without initializers is #f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/defstruct

    r35627 r39530  
    2424or a list of the form {{(NAME INIT)}} where {{INIT}} is the default
    2525value of the slot (the {{INIT}} expression will only be evaluated when
    26 no value is given in the constructor procedure).  The {{defstruct}}
    27 macro expands into predicate and accessor functions (just like the
    28 native {{define-record}}):
     26no value is given in the constructor procedure. It defaults to {{#f}}
     27when none is provided).
     28
     29The {{defstruct}} macro expands into predicate and accessor functions
     30(just like the native {{define-record}}):
    2931
    3032<enscript highlight="scheme">
     
    4951 => ; a point with x = 99 and y = 42
    5052</enscript>
     53
     54If keywords for some slots are missing, their initialization values
     55default to those supplied in the {{defstruct}} call, or else {{#f}}.
    5156
    5257There are also two procedures {{update-STRUCTNAME}} and
Note: See TracChangeset for help on using the changeset viewer.