the if statement in TCL

前端 未结 4 817
忘掉有多难
忘掉有多难 2021-02-04 06:26

I have a question about if statement in tcl of the following code:

if {(($number == 1)&&($name == \"hello\")) || (($number == 0)&&($name == \"yes         


        
4条回答
  •  时光取名叫无心
    2021-02-04 06:30

    In short: if uses a special "mini language" for its condition script — the same understood by the expr command. This is stated in the if manual page:

    The if command evaluates expr1 as an expression (in the same way that expr evaluates its argument).

    In contrast to Tcl itself, which is quite LISP-like and/or Unix shell-like, that "expr mini language" is way more "traditional" in the sense it feels like C.

提交回复
热议问题