Re: Opinions? Tcl Python Perl, Virtues/failings

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

>>>>> "PdS" == Peter da Silva <peter@nmti.com> writes:

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

PdS> Obscure, particularly using - instead of !=.

yes, i'm not sure *why* i jumped to that.
too much obscure C-ing, i guess. :-)

the advantage of using "if" was that the expr call was implied.
but then i needed to call "format". i'd say the original way,
expr $hostsNoticed != 1 ? "s" : ""
is the best, because it takes the minimal number of subcommands, and
is the most "algebraic" of the lot, which some people seem to prefer.
but this is all getting away from the point...

(how about
string range s [expr $hostsNoticed == 1] end
:-) i promise to stop now.)

-- 
Hume Smith                                        hclsmith@ra.isisnet.com

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