Sujet : Re: tcl hidden "cruelties"
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.lang.tclDate : 11. Oct 2024, 08:51:49
Autres entêtes
Message-ID : <ygabjzrf562.fsf@akutech.de>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
* aotto1968 <
aotto1968@t-online.de>
| Regardless of "broken code", TCL itself has some cruelties in its
| syntax. Here, for example, the storage of an "array" with a namespace
| path, which in TCL always has !! TWO !! commands. ONE command to
| generate the namespace and ONE command to finally
| generate the array.
>
| namespace eval ::funcDEF::MkErrN {}
| array set ::funcDEF::MkErrN::my {
| RETURN_MAPPING {}
--<snip-snip>--
| var0 mng
| }
Well, you *could* do it in one step, but you don't have to ;-)
namespace eval ::funcDEF::MkErrN {
variable my
array set my {
RETURN_MAPPING {}
...
var0 mng
}
}
HTH
R'