9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] p9p rc flag e +
@ 2013-03-21 13:29 dexen deVries
  2013-03-21 14:22 ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: dexen deVries @ 2013-03-21 13:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

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

[[[↓][→]]]

[-- Attachment #2: mkfile --]
[-- Type: text/plain, Size: 324 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-21 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-21 13:29 [9fans] p9p rc flag e + dexen deVries
2013-03-21 14:22 ` erik quanstrom
2013-03-21 14:58   ` dexen deVries
2013-03-21 15:27     ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).