summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-02-27 22:38:44 -0500
committerDavid Thompson <dthompson2@worcester.edu>2016-02-27 22:38:44 -0500
commitb37d0d0cd6d0f9cb26df1d64caf3e99cb9f37d98 (patch)
treee305582eb6c9e19a3a6d79d7ffe7f55260348ea0
parent8209011c3c84780ed4652c7636e92b1a1d80d4ff (diff)
fixup packed record type
-rw-r--r--sly/records.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/sly/records.scm b/sly/records.scm
index 3ac2fda..ae6d182 100644
--- a/sly/records.scm
+++ b/sly/records.scm
@@ -81,8 +81,13 @@ overridden."
...
(display " >" port)))
- (define-inlinable (constructor field ...)
- (box (f64vector field ...)))
+ (define constructor
+ (let ((size (length (list 'field ...))))
+ (lambda (field ...)
+ (let ((bv (make-f64vector size)))
+ (f64vector-set! bv index field)
+ ...
+ (box bv)))))
(define-inlinable (getter obj)
(f64vector-ref (unbox obj) index))