get_defined_vars?

From: Luciano ES (me_at_privacy.net)
Date: 11/30/03


Date: Sun, 30 Nov 2003 12:18:33 -0200

There is this function in PHP, get_defined_vars: it returns an array of
all defined variables. Is there anything like that in Tcl?

Assuming there isn't, let me propose another problem. I came up with my
own solution:

proc sset {set var} {
global $set allvars
        set $set $var
        set allvars($set) $var
}

proc getallvars {} {
global allvars
        foreach { key value } [ array get allvars ] {
        puts [list $key = $value]
        }
}

It works. But what if I am not happy with "sset"? Supposed I want to
modify the "set" command. It would become an infinite loop.

Thank you.

-- 
Luciano ES
WARNING: fake address on reply!
<yhp-gpyre ng OenmvyvnaGenafyngvba.arg> (ROT 13)
Santos, SP - Brasil