|
From: Andreas L. <av...@lo...> - 2008-06-13 18:33:21
|
> On Fri, Jun 13, 2008 at 3:49 PM, Andreas Leitgeb <av...@lo...> wrote: > > The "string is dict" could be used for some entrance check of > > a parameter, that could be already a dict, or an arbitrary > > string, and where one needs to be "rather safe than sorry". I just noticed that current implementation of [string is list $l] fails to shortcut for pure list-objects. How can that be observed in tcl? so: string is list [lrepeat 1000000 [lrepeat 1000000 x]] If it bombs the tclsh, it tried to serialize the list: "string representation size exceeds sane bounds" Is that a bug, or a deliberate miss out? Anyway, it limits the practicability of [string is dict|list...] for parameter entry-validation in procedures severely. I think, it makes sense to make the "string is"-family fit for parameter-validation purposes, but that would require that the value to be checked is not principially shimmered to string, at least not if it is already of the type it's being queried for. Otoh, it's acceptable that e.g. a list-object queried for it's integerness is still shimmered. |