mailto:rohan@rohanpall.comhttp://rohanpall.com proc a> {a args} {eval [list interp alias {} $a {}] $args}
a> p puts ; a> s set
a> sr list ::S ; a> ss s [sr] ; ss {1 2 3}
a> . eval {lindex [ss] 0}
a> drop eval {ss [lreplace [ss] 0 0]}
a> ex eval {eval [.] ; drop}
a> ? s errorInfo
|ex apply to a list
% proc a> {a args} {eval [list interp alias {} $a {}] $args}
% proc |ex {s x} {foreach a [split $x |] {eval $s $a}}
% set n 0
0
% |ex {a> c[incr ::n] puts} {a|b|c}
% c1
a
% c2
b
% c3
c
aka set/get an alias
% proc a> {a args} {eval [list interp alias {} $a {}] $args}
% a> a< interp alias {}
a<
% a> g uplevel #0
g
% a< g
uplevel #0
save typing lots of aliases % |ex a> {pk proc | g uplevel #0 | r puts "in the end, nothing"}
From Alan Donaly's page [
1] (
AMG: 404):
Tcl/tk actually two langs but they are bound together like spaghetti and marinara .