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
|
(let
|
||||||
((varname (first rest-args)))
|
((varname (first rest-args)))
|
||||||
(let
|
(let
|
||||||
((val (frame-lookup (get interp :frame) varname)))
|
((val (tcl-var-lookup-or-nil interp varname)))
|
||||||
(assoc interp :result (if (nil? val) "0" "1")))))
|
(assoc interp :result (if (nil? val) "0" "1")))))
|
||||||
((equal? sub "hostname") (assoc interp :result "localhost"))
|
((equal? sub "hostname") (assoc interp :result "localhost"))
|
||||||
((equal? sub "script") (assoc interp :result ""))
|
((equal? sub "script") (assoc interp :result ""))
|
||||||
@@ -3547,7 +3547,7 @@
|
|||||||
; Look up a Tcl var by name, returning nil instead of erroring if missing.
|
; 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.
|
; Handles `::var` global-prefix routing the same way tcl-var-get does.
|
||||||
(define
|
(define
|
||||||
tcl-vwait-lookup
|
tcl-var-lookup-or-nil
|
||||||
(fn
|
(fn
|
||||||
(interp name)
|
(interp name)
|
||||||
(if
|
(if
|
||||||
@@ -3570,7 +3570,7 @@
|
|||||||
(let
|
(let
|
||||||
((name (first args)))
|
((name (first args)))
|
||||||
(let
|
(let
|
||||||
((initial (tcl-vwait-lookup interp name)))
|
((initial (tcl-var-lookup-or-nil interp name)))
|
||||||
(assoc (tcl-vwait-loop interp name initial) :result ""))))))
|
(assoc (tcl-vwait-loop interp name initial) :result ""))))))
|
||||||
|
|
||||||
(define
|
(define
|
||||||
@@ -3578,7 +3578,7 @@
|
|||||||
(fn
|
(fn
|
||||||
(interp name initial)
|
(interp name initial)
|
||||||
(let
|
(let
|
||||||
((cur (tcl-vwait-lookup interp name)))
|
((cur (tcl-var-lookup-or-nil interp name)))
|
||||||
(if
|
(if
|
||||||
(and (not (nil? cur)) (not (equal? cur initial)))
|
(and (not (nil? cur)) (not (equal? cur initial)))
|
||||||
interp
|
interp
|
||||||
|
|||||||
Reference in New Issue
Block a user