tcl compound condition

Can anyone explain for me why this does not work in tcl:

if !{( $a > "" || $b > "" )} { .......

where a and b are string vars.
and this works instead:

if {!( $a > "" || $b > "" )} { ........

Thanks.

Because the second example uses the correct syntax, no?

Well,
I thought a syntax like

if !{ ....... } { .....

is also valid, am I wrong on this?
Thanks.

I'm getting a syntax error when I'm using that syntax.

This works fine ....

set WRITE 1
.
.
.
if !{$WRITE} { .......

What do you think?
Thanks.

As I already said, the braces are part of the if syntax. You need them for grouping, so if sees one argument. This is how the parser works.

tcl wiki

In your last example (a single word expression) if does not require grouping (braces) anyway.

It's just how the tcl parser works. Consider the following:

% set a 1
1
% if !{ $a > 0 } { puts "OK" } ;# syntax error
missing close-brace
% 
% if !{$a>0} { puts "OK" } ;# no spaces, one word and the error changes
can't use non-numeric string as operand of "!"

It works with one word (no syntax error), but omitting the spaces between the elements forces the expression to be threated as a string:

% puts {$a>0}
$a>0

Hope this helps.

Thanks