diff options
author | Andy Wingo <wingo@pobox.com> | 2009-02-27 10:56:15 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-02-27 10:56:15 +0100 |
commit | 246be37e487ec39bd945bbfdef410a5251f71adc (patch) | |
tree | ea8c0d64b78fd7be2102b1be67955fce47cb3160 /module/system/base/syntax.scm | |
parent | 2c65f2d5a7b5f6e75179d66c32c1de5380b334cc (diff) | |
download | guile-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.
Diffstat (limited to 'module/system/base/syntax.scm')
-rw-r--r-- | module/system/base/syntax.scm | 9 |
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))))))) |