diff options
-rw-r--r-- | sly/records.scm | 9 |
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)) |