9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <9fans@hamnavoe.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] termrc changes
Date: Tue, 28 Nov 2006 20:11:35 +0000	[thread overview]
Message-ID: <5af6e2ed0383fbe611b91c4569eff7b6@hamnavoe.com> (raw)
In-Reply-To: <85ddf2f6f3d679b9fc463f5dda358380@plan9.bell-labs.com>

>  If test were modified to process
> all its arguments at the start (presumably building an expression
> tree), it could then complain about excess arguments again.

I have a modified version of test which uses a parameter for e(),
e1(), etc to determine whether sub-expressions should be evaluated
or just parsed.  This allows the whole test command to be checked
for syntax, while preserving the lazy semantics ("short circuit")
of -a and -o.

I haven't submitted it because it seems somehow clunky.

A much simpler change would be just to have -a and -o behave like &
and | instead of like && and ||; in other words, to perform both tests
(and therefore syntax check the whole command) before combining the
boolean results.  I've looked at the posix description of test and it
doesn't actually say that -a and -o have to be lazy.  Would this cause
any problems in practice?

-- Richard



  reply	other threads:[~2006-11-28 20:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-28 17:35 Joel Salomon
2006-11-28 19:37 ` geoff
2006-11-28 20:11   ` Richard Miller [this message]
2006-11-29  4:43   ` Lucio De Re
2006-11-29 14:54     ` ron minnich
2006-11-29 16:39       ` Lucio De Re
2006-11-29 16:40       ` Russ Cox
2006-11-29 16:50         ` ron minnich
2006-11-30  0:37           ` erik quanstrom
2006-11-30  1:15             ` Martin Neubauer
2006-11-30  0:29       ` erik quanstrom
2006-11-30  0:34         ` ron minnich
2006-11-29 20:40     ` Georg Lehner
2006-11-30  4:34       ` Lucio De Re
2006-11-30  4:35         ` geoff
2006-11-30  4:58           ` Lucio De Re
2006-11-29  9:19 Fco. J. Ballesteros
2006-11-29 18:47 ` geoff
2006-11-29 18:59   ` Francisco J Ballesteros
2006-11-29 20:08     ` Charles Forsyth
2006-12-01  1:19   ` John Floren
2006-12-01  1:38     ` geoff
2006-12-01  2:09       ` Bruce Ellis
2006-12-01  3:11         ` John Floren
2006-12-01  3:15           ` Bruce Ellis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5af6e2ed0383fbe611b91c4569eff7b6@hamnavoe.com \
    --to=9fans@hamnavoe.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).