Make sure jacl works with these test cases!





From - Tue Feb  9 14:34:20 1999
Path: news1.tc.umn.edu!newshub.tc.umn.edu!fu-berlin.de!newsfeed.berkeley.edu!news2.best.com!news3.best.com!nntp1.ba.best.com!not-for-mail
From: me_og@usa.net
Subject: [Bug Tcl 8.1b1] "!" operator can't handle string booleans
Newsgroups: comp.lang.tcl
Date: 09 Feb 1999 04:45:05 GMT
Lines: 42
Message-ID: <36bfbd51$0$16670@nntp1.ba.best.com>
NNTP-Posting-Host: 209.24.201.136
X-Trace: nntp1.ba.best.com 918535505 16670 209.24.201.136
Xref: news1.tc.umn.edu comp.lang.tcl:100404

Tcl 8.1b1 Bug:  Generated by Scriptics' bug entry form at

	http://www.scriptics.com/support/bugForm.html

Responses to this post are encouraged.

------

Submitted by:  Steve McAndrewSmith
OperatingSystem:  Linux (libc)
OperatingSystemVersion:  2.0.35
Synopsis:  "!" operator can't handle string booleans

ReproducibleScript:
# These all work fine ...
set b 1
if { $b } { puts "ooga" }

set b 0
if { ! $b } { puts "ooga" }

set b yes
if { $b } { puts "ooga" }

set b no
if { $b } { puts "no ooga" } else { puts "ooga" }

if { ($b && $b) || $b } { puts "ooga ooga ooga" }

# This produces an error.:  can't use non-numeric string as operand of "!"
if { ! $b } { puts "GAKK!" }


ObservedBehavior:
When using string boolean values (e.g. "true", "false", "yes", "no") in if expressions, the negation operator ("!") does not recognize the strings as boolean values.  Only "0" and "1" are correctly accepted.  It gives the following error:

  can't use non-numeric string as operand of "!" 

However, both "&&" and "||" (and probably others) accept these boolean strings correctly.

DesiredBehavior:
"!true",  "!false", "!yes", and "!no" should all evaluate correctly.
