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


15.4.4 Generating identifiers for structs API

Function: identifier-struct-constructor type-id

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

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

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

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

Assume type-id is an identifier representing the name of a Vicare struct 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 struct type. field-name can be a string, symbol or identifier.

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

Assume type-id is an identifier representing the name of a Vicare struct 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 struct type. field-name can be a string, symbol or identifier.

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