Next: , Previous: , Up: expander utils   [Index]


15.4.3 Generating identifiers for records API

Function: identifier-record-constructor type-id

Assume type-id is an identifier representing the name of a R6RS record type: build and return a new identifer, in the same lexical context of type-id, representing the default constructor name for such record type.

(bound-identifier=?
 (identifier-record-constructor #'alpha)
 #'make-alpha)
⇒ #t
Function: identifier-record-predicate type-id

Assume type-id is an identifier representing the name of a R6RS record type: build and return a new identifer, in the same lexical context of type-id, representing the default predicate name for such record type.

(bound-identifier=?
 (identifier-record-predicate #'alpha)
 #'alpha?)
⇒ #t
Function: identifier-record-field-accessor type-id field-name

Assume type-id is an identifier representing the name of a R6RS record type: build and return a new identifer, in the same lexical context of type-id, representing the default accessor name for the field field-name of such record type. field-name can be a string, symbol or identifier.

(bound-identifier=?
 (identifier-record-field-accessor #'alpha "one")
 #'alpha-one)
⇒ #t
Function: identifier-record-field-mutator type-id field-name

Assume type-id is an identifier representing the name of a R6RS record type: build and return a new identifer, in the same lexical context of type-id, representing the default mutator name for the field field-name of such record type. field-name can be a string, symbol or identifier.

(bound-identifier=?
 (identifier-record-field-mutator #'alpha "one")
 #'alpha-one-set!)
⇒ #t