From b37d0d0cd6d0f9cb26df1d64caf3e99cb9f37d98 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 27 Feb 2016 22:38:44 -0500 Subject: fixup packed record type --- sly/records.scm | 9 +++++++-- 1 file 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)) -- cgit v1.2.3