((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/records" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "records" (p "This extension provides a procedural interface to create records, similar to the " (tt "define-record") " and " (tt "define-record-type") " (" (link "http://srfi.schemers.org/srfi-9" "SRFI-9") ") constructs.") (p "To use this extension, execute") (p (tt "(require-extension records)")) (p "in your code. This extension provides the " (tt "records") " module.") (section 3 "make-record-type" (def (sig (procedure "(make-record-type type-name field-names)" (id make-record-type))) (p "Returns a \"record-type descriptor\", a value representing a new datatype disjoint from all others.  The TYPE-NAME argument must be a symbol or a string. The FIELD-NAMES argument is a list of symbols naming the \"fields\" of a record of the new type.  It is an error if the list contains any duplicates."))) (section 3 "record-constructor" (def (sig (procedure "(record-constructor rtd [field-names])" (id record-constructor))) (p "Returns a procedure for constructing new members of the type represented by RTD.  The returned procedure accepts exactly as many arguments as there are symbols in the given list, FIELD-NAMES; these are used, in order, as the initial values of those fields in a new record, which is returned by the constructor procedure.  The values of any fields not named in that list are unspecified.  The FIELD-NAMES argument defaults to the list of field names in the call to " (tt "make-record-type") " that created the type represented by RTD; if the FIELD-NAMES argument is provided, it is an error if it contains any duplicates or any symbols not in the default list."))) (section 3 "record-predicate" (def (sig (procedure "(record-predicate rtd)" (id record-predicate))) (p "Returns a procedure for testing membership in the type represented by RTD.  The returned procedure accepts exactly one argument and returns a true value if the argument is a member of the indicated record type; it returns a false value otherwise."))) (section 3 "record-accessor" (def (sig (procedure "(record-accessor rtd field-name)" (id record-accessor))) (p "Returns a procedure for reading the value of a particular field of a member of the type represented by RTD.  The returned procedure accepts exactly one argument which must be a record of the appropriate type; it returns the current value of the field named by the symbol FIELD-NAME in that record.  The symbol FIELD-NAME must be a member of the list of field-names in the call to " (tt "make-record-type") " that created the type represented by RTD."))) (section 3 "record-modifier" (def (sig (procedure "(record-modifier rtd field-name)" (id record-modifier))) (p "Returns a procedure for writing the value of a particular field of a member of the type represented by RTD.  The returned procedure accepts exactly two arguments: first, a record of the appropriate type, and second, an arbitrary Scheme value; it modifies the field named by the symbol FIELD-NAME in that record to contain the given value.  The returned value of the modifier procedure is unspecified.  The symbol FIELD-NAME must be a member of the list of field-names in the call to " (tt "make-record-type") " that created the type represented by RTD."))) (section 3 "Authors" (p "David Carlton, re-written by Aubrey Jaffer, ported to CHICKEN by " (int-link "/users/felix winkelmann" "felix winkelmann"))) (section 3 "License" (p "Public domain")) (section 3 "History" (dl (dt "1.3") (dd "removed " (tt "-host") " option from setup script") (dt "1.2") (dd "ported to CHICKEN 4") (dt "1.0") (dd "Initial release")))))