Re: Opinions? Tcl Python Perl, Virtues/failings

Peter da Silva (peter@nmti.com)
Fri, 31 Mar 1995 18:26:36 GMT

In article <STU7X93.95Mar31100116@bmerhaeb.bnr.ca>,
Hume C.L. Smith <hclsmith@ra.isisnet.com> wrote:
> >>>>> "PdS" == Peter da Silva <peter@nmti.com> writes:
> >> [someone else - oops]
> >> The "word basis" of tcl operations breaks down pretty quick. What
> >> about:

> >> [expr {($hostsNoticed > 1) ? "s" : ""}]

> PdS> I wouldn't write that. I'd write:

> PdS> [lindex [list "" s] [expr "$hostsNoticed > 1"]]

> *blink* that's an improvement? personally, i had no problem with the
> other way :-)

Sure. Less potential for quoting problems.

> any particular reason you write [list "" s] instead of {"" s} or {\ s}?

I tend to use [list] to create lists when the standard syntax might be
confusing.

> how about [if {$hostsNoticed - 1} {format s}]
> [lindex s [expr !($hostsNoticed - 1)]]

Obscure, particularly using - instead of !=.

-- 
Peter da Silva                                            `-_-'
Network Management Technology Incorporated                 'U`
1601 Industrial Blvd.     Sugar Land, TX  77478  USA
+1 713 274 5180                                "Har du kramat din varg idag?"