5

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
Draif Kroneg
  • 743
  • 13
  • 34

1 Answers1

5

Logical 'not' is an arithmetic operator, so you need expr

% set x true
true
% puts [expr {!$x}]
0
% puts [expr {!!$x}]
1
glenn jackman
  • 238,783
  • 38
  • 220
  • 352