get_defined_vars?
From: Luciano ES (me_at_privacy.net)
Date: 11/30/03
- Next message: Luciano ES: "cedilla: bug or feature?"
- Previous message: Donald Arseneau: "Re: for problem..."
- Next in thread: miguel sofer: "Re: get_defined_vars?"
- Reply: miguel sofer: "Re: get_defined_vars?"
- Reply: Cameron Laird: "Re: get_defined_vars?"
- Reply: Benjamin Riefenstahl: "Re: get_defined_vars?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Luciano ES: "cedilla: bug or feature?"
- Previous message: Donald Arseneau: "Re: for problem..."
- Next in thread: miguel sofer: "Re: get_defined_vars?"
- Reply: miguel sofer: "Re: get_defined_vars?"
- Reply: Cameron Laird: "Re: get_defined_vars?"
- Reply: Benjamin Riefenstahl: "Re: get_defined_vars?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]