1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 23:50:47 +02:00

Allocate a static tc16 for random states

* libguile/random.h (scm_t_rstate): Put a tag word in the beginning.
(scm_is_random_state, scm_to_random_state, scm_from_random_state): New
helpers.
(SCM_RSTATEP, SCM_RSTATE): Use the new helpers.
(scm_masktab): Make private.
* libguile/random.c: Adapt random states to not be a smob.
* libguile/eq.c:
* libguile/print.c:
* libguile/scm.h:
* module/oop/goops.scm: Add new random-state cases.  Fix a number of
classes for other types that were recently changed to not be smobs.
This commit is contained in:
Andy Wingo 2025-06-17 10:36:32 +02:00
parent 63317ff480
commit ccaff3da39
7 changed files with 57 additions and 45 deletions

View file

@ -755,6 +755,11 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
case scm_tc16_syntax_transformer:
scm_i_print_syntax_transformer (exp, port, pstate);
break;
case scm_tc16_random_state:
scm_puts ("#<random-state ", port);
scm_uintprint (SCM_UNPACK (exp), 16, port);
scm_putc ('>', port);
break;
default:
abort ();
}