Re: Opinions? Tcl Python Perl, Virtues/failings

Hume C.L. Smith (stu7x93@bmerhaeb.bnr.ca)
31 Mar 1995 15:01:16 GMT

>>>>> "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 :-)

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

(or - sometimes i'm humour-impaired - were you doing a deadpan?)

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

(i know these return "s" for 0, too; i usually say "0 hosts" though.)

-- 
Hume Smith                                        hclsmith@ra.isisnet.com

"What are you doing?" "I'm spelunking." "There's a medicine you can take for that." Buster & Babs