Re: parray improvements
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: parray improvements

From: Arjen Markus <arjen.markus@wldelft.nl>
Date: Fri Jun 03 2005 - 13:46:54 CEST

Kaitzschu wrote:
>

>
> This is not backwards compatible. Good for Tcl9, I guess. Until then,
>
> parray array ?pattern=* ?channel=stdout??
>
> Clumsy (forces channelwriters to specify pattern) but is compatible as
> parray accepted only one parameter. Using empty channel name just returns
> list of formatted lines (true channel can't have empty name?). At Tcl9
> backward compatibility can be broken by adding true switches to [parray].
>
> Memorywasting when printing huge arrays is reduced by wasting clock cycles
> to check channel at every iteration. Diff is against 8.5a2 parray.tcl
> (I failed to find those cvs head differences).
>

Oh, I forgot about the pattern ... Yes, you are right, that makes
it less trivial. However, would it be disastrous to be not 100%
compatible:

- If an option is given, then it must start with a "-"
- Patterns often have * or ? in them

So my proposal would preclude:
- array names that start with a "-"
- patterns without wild-cards
- (and possibly only the combination)

Regards,

Arjen
Received on Thu Sep 29 14:20:03 2005