summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-27 10:56:15 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-27 10:56:15 +0100
commit246be37e487ec39bd945bbfdef410a5251f71adc (patch)
treeea8c0d64b78fd7be2102b1be67955fce47cb3160
parent2c65f2d5a7b5f6e75179d66c32c1de5380b334cc (diff)
downloadguile-246be37e487ec39bd945bbfdef410a5251f71adc.tar.gz
common slot accessors are procedures-with-setters
* module/system/base/syntax.scm (define-type): Common slot accessors are also procedures-with-setters.
-rw-r--r--module/system/base/syntax.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/system/base/syntax.scm b/module/system/base/syntax.scm
index 35748bb79..867720cdb 100644
--- a/module/system/base/syntax.scm
+++ b/module/system/base/syntax.scm
@@ -47,10 +47,11 @@
,@(cdr def)))
rest)
,@(map (lambda (common-slot i)
- `(define (,(symbol-append (trim-brackets name)
- '- common-slot)
- x)
- (struct-ref x ,i)))
+ `(define ,(symbol-append (trim-brackets name)
+ '- common-slot)
+ (make-procedure-with-setter
+ (lambda (x) (struct-ref x ,i))
+ (lambda (x v) (struct-set! x ,i v)))))
common-slots (iota (length common-slots)))))))