Reputation: 783
I have not managed to find out how to negate booleans in TCL... I tried:
set x true
puts !$x #prints '!true'
puts ![$x] #prints !
puts [!$x] #prints no event matches "true"
puts !{$x} #prints !{true}
puts {!$x} #prints !$x
Upvotes: 7
Views: 5927
Reputation: 247250
Logical 'not' is an arithmetic operator, so you need expr
% set x true
true
% puts [expr {!$x}]
0
% puts [expr {!!$x}]
1
Upvotes: 7