in p9p rc, an `if (/bin/false)' statement without `if not' statement causes 
non-empty $status, and thus will terminate mk.

for example, the attached mkfile returns error for target `breaks', but works 
for target `works', with the difference being that of trailing `if not'.

from my point of view, the `if (/bin/false)' statement spills the non-empty 
$status from the conditional expression to its outern scope. perhaps this is 
to simplify implementation of `if not', but it irks me.

is that really the expected behavior, or is it a quirk of p9p rc?

is there a point to, or an use case for this behavior?


-- 
dexen deVries

[[[↓][→]]]
MKSHELL=$PLAN9/bin/rc

test:VQ: positive negative
        echo success.

positive:VQ:
        if (test -e mkfile)
                echo the file exists

negative:VQ:
                # any file or dir that is sure not to exist
                # if we have a file `mkfile', then for sure we don't have a dir 
`mkfile/'
        if (test -e mkfile/)
                echo SHOULD NOT BE REACHED

Reply via email to