Version 3 of unless

Updated 2004-05-04 15:22:11

proc unless {condition body} {

        uplevel [list if "!($condition)" $body]
    }

example:

    unless {$tcl_version >= 8.4} {
        error "package requires Tcl version 8.4 or greater"
    }

Lars H: An alternative implementation, which avoids shimmering:

    proc unless {condition body} {
        uplevel 1 [list if $condition then {} else $body]
    }