1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

Give reified value objects a proper data type

* libguile/values.h (struct scm_values): New build-time definition.
(scm_to_values):
(scm_from_values):
(scm_values_count):
(scm_values_ref): New helpers.
* libguile/vm.c:
* libguile/values.c:
* libguile/print.c:
* libguile/numbers.c:
* libguile/eval.c: Adapt all callers.
This commit is contained in:
Andy Wingo 2025-05-30 09:57:08 +02:00
parent aa73d31ded
commit 224fb82a39
6 changed files with 83 additions and 55 deletions

View file

@ -1228,10 +1228,11 @@ expand_apply_argument (scm_thread *thread)
static void
unpack_values_object (scm_thread *thread, SCM obj)
{
size_t n, nvals = scm_i_nvalues (obj);
struct scm_values *values = scm_to_values (obj);
size_t n, nvals = scm_values_count (values);
alloc_frame (thread, nvals);
for (n = 0; n < nvals; n++)
SCM_FRAME_LOCAL (thread->vm.fp, n) = scm_i_value_ref (obj, n);
SCM_FRAME_LOCAL (thread->vm.fp, n) = scm_values_ref (values, n);
}
static void