aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2024-12-30 09:52:23 -0500
committerGravatar Peter McGoron 2024-12-30 09:52:23 -0500
commit27eaddbc13849e5b0e214bca956048c22fadb1c8 (patch)
tree1eff0fa16a776b43d5dccd8fb44fee85e0795722 /doc
parentdefine-record-type/destructor (diff)
fix define-record-type/destructor and refactor tests
Diffstat (limited to 'doc')
-rw-r--r--doc/mcgoron.cond-thunk.values.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/mcgoron.cond-thunk.values.scm b/doc/mcgoron.cond-thunk.values.scm
index 5f2265f..c319f3d 100644
--- a/doc/mcgoron.cond-thunk.values.scm
+++ b/doc/mcgoron.cond-thunk.values.scm
@@ -51,4 +51,19 @@ list is returned as values."))
(desc "
Evaluates `producer`. If `producer` evaluates to at least one value, then
return a thunk that, when called, tail-calls `consumer` with the values
-that `producer` produced. Otherwise, return `#f~."))) \ No newline at end of file
+that `producer` produced. Otherwise, return `#f~."))
+ ((name . "define-record-type/destructor")
+ (signature syntax-rules () ((_ type-name
+ (cstr fields ...)
+ predicate?
+ destructor=>
+ field-spec ...)))
+ (desc "
+Creates a record type using `define-record-type`, and also creates a
+destructor procedure of a single argument named `destructor=>`. When
+`destructor=>` is called with a record of this type, it returns as values
+each field of the record as declared in the `field-spec`. Otherwise it
+returns no values.
+
+Note that the destructor will always return no values for a record type
+that has no fields."))) \ No newline at end of file