From c58a9927ae222a26ec97fd5357fb5a519cb2dc22 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 19 Jul 2021 16:56:06 -0400 Subject: [PATCH] Issue #404 - Do not require all fields to be listed in constructor --- CHANGELOG.md | 1 + scheme/base.sld | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf68bfb7..c9ed1088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Bug Fixes - Properly escape question marks within strings in generated C code to avoid trigraphs. - Eliminate clang compiler warnings referencing `EOF` when building the runtime. - Fixed code so that the C compiler will no longer generate warnings regarding the string comparisons in `Cyc_st_add`. Previously this could result in these warnings being spammed to the console when compiling code using Cyclone. +- Allow a record type to contain fields that are not initialized by the constructor. ## 0.30.0 - July 2, 2021 diff --git a/scheme/base.sld b/scheme/base.sld index 9bd3c826..a6ee8696 100644 --- a/scheme/base.sld +++ b/scheme/base.sld @@ -2115,7 +2115,10 @@ (make-record-marker) (quote ,name) (,(rename 'vector) - ,@make-fields)))) + ,@make-fields ;; Pass field values sent to constructor + ,@(make-list ;; And include empty slots for any other fields + (- (length (cddddr expr)) + (length make-fields))) )))) ))))) (define-syntax define-values