On 16 May 2001, David N. Welton wrote:
> I don't really like their solution in any case, but I am getting the
> feeling that a hack of some type is just unavoidable.
Yeap, they just did a quick-hack and are happy about it ;-)
> > My priorities are:
> >
> > - Being able to retrieve all variables :)
> >
> > - Having a consistent way to do it
> >
> > - ok, the performance is important, too...
>
> > For my purposes a key-value list would be a great thing; other
> > methods to access a single variable could be useful but not
> > mandatory; I'd probably end not using them, anyway.
> If you know that a variable could be a list, you check LVARS(name),
> and if it exists, then you can be sure that VARS(name) is a list, and
> not a string beginning with {.
I'd rather not to be surprised when my script accidentally sends id
several times - this sometimes happens when you do <FORM> with POST, while
testing with GET and being a bit surprised by ID being {2 3} ;-)
> Does that sound fair? That was your original suggestion as I
> understood it the other day, it is easy to implement, and it isn't
> *too* awfully wierd.
It's still a bit weird for me :-)
> The only other thing that seems acceptable is a command, but that is
> slower, and will require reworking of existing scripts. And in any
> case, you still have to know when your variable might be a list:
>
> set lst [ vars get -list foo ]
>
> It is cleaner though, more flexible, and also extensible.
I prefer that one.
It only does any additional stuff when needed. While the first one seems a
bit weird to me... Besides, doing lsearch in VARSL may be a bit slow as
well.
--
Wojtek Kocjan
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]