tcl: rename tcl-vwait-lookup → tcl-var-lookup-or-nil; use in info exists
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
Generalized helper for var-lookup-with-:: so info exists also works on ::-prefixed names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3096,7 +3096,7 @@
|
||||
(let
|
||||
((varname (first rest-args)))
|
||||
(let
|
||||
((val (frame-lookup (get interp :frame) varname)))
|
||||
((val (tcl-var-lookup-or-nil interp varname)))
|
||||
(assoc interp :result (if (nil? val) "0" "1")))))
|
||||
((equal? sub "hostname") (assoc interp :result "localhost"))
|
||||
((equal? sub "script") (assoc interp :result ""))
|
||||
@@ -3547,7 +3547,7 @@
|
||||
; Look up a Tcl var by name, returning nil instead of erroring if missing.
|
||||
; Handles `::var` global-prefix routing the same way tcl-var-get does.
|
||||
(define
|
||||
tcl-vwait-lookup
|
||||
tcl-var-lookup-or-nil
|
||||
(fn
|
||||
(interp name)
|
||||
(if
|
||||
@@ -3570,7 +3570,7 @@
|
||||
(let
|
||||
((name (first args)))
|
||||
(let
|
||||
((initial (tcl-vwait-lookup interp name)))
|
||||
((initial (tcl-var-lookup-or-nil interp name)))
|
||||
(assoc (tcl-vwait-loop interp name initial) :result ""))))))
|
||||
|
||||
(define
|
||||
@@ -3578,7 +3578,7 @@
|
||||
(fn
|
||||
(interp name initial)
|
||||
(let
|
||||
((cur (tcl-vwait-lookup interp name)))
|
||||
((cur (tcl-var-lookup-or-nil interp name)))
|
||||
(if
|
||||
(and (not (nil? cur)) (not (equal? cur initial)))
|
||||
interp
|
||||
|
||||
Reference in New Issue
Block a user