"David N. Welton" wrote:

>
> > > We could also create a command that does all the extra things we
> > > want, precisely how we want.
>
> > > set VARSL [vars list]
> > > set foo [vars get foo]
> > > set foo [vars get -array foo]
>
> So what commands would people like to see for this?
>
> vars get xyz
> vars list
> var arraylist xyz # returns a list suitable for use in an array.
>

What I like best is:

     set xxx [vars arraylist];         #to get a list of key-value pairs in
$xxx

To improve speed, in some cases:
     set xxx [vars get xyz];           #to get the value of xyz in $xxx
could go, but one MUST first check for the existence of xyz... what if xyz
is undefined? We should have something like 'vars exists xyz':

if {[vars exists xyz]} {
      set xyz [vars get xyz];
      puts "The value of xyz is $xyz"
   }

...I'm afraid this would be even slower, on most cases. In 99% of
applications the script uses all the parameters.



Valerio Gionco
MOST s.r.l.

--
****************************************************************************
            "Life's not fair, but the root password helps."




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to