built-in (skint hidden) lib for hidden names

This commit is contained in:
ESL 2024-07-16 23:15:08 -04:00
parent 9d9c95b6e2
commit 458328c43f
2 changed files with 9 additions and 1 deletions

View file

@ -1854,7 +1854,7 @@
(define *root-name-registry* (make-name-registry 300)) (define *root-name-registry* (make-name-registry 300))
; nonpublic registry for all hidden skint names (used by built-in macros) ; 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) (define (builtin-sr-environment id at)
(cond [(new-id? id) (new-id-lookup id at)] (cond [(new-id? id) (new-id-lookup id at)]
@ -2027,6 +2027,10 @@
(name-install! *hidden-name-registry* (caar lst) (cdar lst)) (name-install! *hidden-name-registry* (caar lst) (cdar lst))
(loop prev (cdr 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 ; private registry for names introduced in repl
(define *user-name-registry* (make-name-registry 200)) (define *user-name-registry* (make-name-registry 200))

4
t.c
View file

@ -1297,6 +1297,10 @@ char *t_code[] = {
"}{.2d,:2,:1V5}${.4ad,.5aa,@(y22:*hidden-name-registry*),@(y13:name-ins" "}{.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", "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, "C", 0,
"${'(i200),@(y18:make-name-registry)[01}@!(y20:*user-name-registry*)", "${'(i200),@(y18:make-name-registry)[01}@!(y20:*user-name-registry*)",