aboutsummaryrefslogtreecommitdiffstats
path: root/srfi-9.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
commit8466d8cfa486fb30d1755c4261b781135083787b (patch)
treec8c12c67246f543c3cc4f64d1c07e003cb1d45ae /srfi-9.scm
parent87b82b5822ca54228cfa6df29be3ad9d4bc47d16 (diff)
downloadslib-8466d8cfa486fb30d1755c4261b781135083787b.tar.gz
slib-8466d8cfa486fb30d1755c4261b781135083787b.zip
Import Upstream version 3a1upstream/3a1
Diffstat (limited to 'srfi-9.scm')
-rw-r--r--srfi-9.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/srfi-9.scm b/srfi-9.scm
new file mode 100644
index 0000000..e55b193
--- /dev/null
+++ b/srfi-9.scm
@@ -0,0 +1,16 @@
+(require 'record)
+(define-syntax define-record-field
+ (syntax-rules ()
+ ((define-record-field type field-tag accessor)
+ (define accessor (record-accessor type 'field-tag)))
+ ((define-record-field type field-tag accessor modifier)
+ (begin (define accessor (record-accessor type 'field-tag))
+ (define modifier (record-modifier type 'field-tag))))))
+;@
+(define-syntax define-record-type
+ (syntax-rules ()
+ ((define-record-type type (constructor constructor-tag ...) predicate (field-tag accessor . more) ...)
+ (begin (define type (make-record-type 'type '(field-tag ...)))
+ (define constructor (record-constructor type '(constructor-tag ...)))
+ (define predicate (record-predicate type))
+ (define-record-field type field-tag accessor . more) ...))))