From 458328c43f6f44fd7e9a7a96159608fee5c41542 Mon Sep 17 00:00:00 2001 From: ESL Date: Tue, 16 Jul 2024 23:15:08 -0400 Subject: [PATCH] built-in (skint hidden) lib for hidden names --- src/t.scm | 6 +++++- t.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/t.scm b/src/t.scm index 83afb18..560be09 100644 --- a/src/t.scm +++ b/src/t.scm @@ -1854,7 +1854,7 @@ (define *root-name-registry* (make-name-registry 300)) ; nonpublic registry for all hidden skint names (used by built-in macros) -(define *hidden-name-registry* (make-name-registry 1)) +(define *hidden-name-registry* (make-name-registry 1)) ; 1 to share bindings w/(skint hidden) (define (builtin-sr-environment id at) (cond [(new-id? id) (new-id-lookup id at)] @@ -2027,6 +2027,10 @@ (name-install! *hidden-name-registry* (caar lst) (cdar lst)) (loop prev (cdr lst))])))) +; make hidden bindings available via (skint hidden) library +(name-install! *root-name-registry* '(skint hidden) + (make-location (make-library '(begin) (vector-ref *hidden-name-registry* 0)))) + ; private registry for names introduced in repl (define *user-name-registry* (make-name-registry 200)) diff --git a/t.c b/t.c index ed6eb49..cd8bb4e 100644 --- a/t.c +++ b/t.c @@ -1297,6 +1297,10 @@ char *t_code[] = { "}{.2d,:2,:1V5}${.4ad,.5aa,@(y22:*hidden-name-registry*),@(y13:name-ins" "tall!)[03}.2d,.2,:0^[32}.!0.0^_1[02}'1,.1+,:3^[11}.!0.0^_1[01}_1_1_1_1", + "C", 0, + "${'0,@(y22:*hidden-name-registry*)V4,'(l1:y5:begin;),V12b,'(l2:y5:skin" + "t;y6:hidden;),@(y20:*root-name-registry*),@(y13:name-install!)[03}", + "C", 0, "${'(i200),@(y18:make-name-registry)[01}@!(y20:*user-name-registry*)",