From: David Hogan <dhog@cs.su.oz.au> (FROBOZZ MAGIC MUTATED GRUE BREEDER CO.)
To: rc whining list <rc@archone.tamu.edu>
Subject: Re: A lighter read function
Date: Thu, 12 Dec 1991 19:47:30 -0600 [thread overview]
Message-ID: <199112131247.3606.rc.badus@cs.su.oz.au> (raw)
In-Reply-To: <26539.692585936@golem.UUCP>
"David J. Fiander" writes:
> x = `{line || echo 1^$nl^1; echo 0}
>
> Then, if line fails, we get
>
> x = (1 1)
>
> otherwise we get
>
> x = ('the line' 0)
Well, actually, if line fails, x is set to (1 1 0). While it is true that
the value of the 3rd element of the list (if one exists) is ignored by the
rest of the function, this is rather sloppy coding. Why not use an if
statement? Ok, so it's more lines of code, but at least you can see at a
glance what is going on (and you avoid making silly logic mistakes like the
one above).
Now if you'll excuse me, I have to clean out my in box.
next prev parent reply other threads:[~1991-12-13 2:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-12-11 4:32 DaviD W. Sanderson
1991-12-11 12:28 ` David J. Fiander
1991-12-11 19:28 ` Chris Siebenmann
1991-12-13 0:58 ` David J. Fiander
1991-12-13 1:37 ` Chris Siebenmann
1991-12-13 1:47 ` David Hogan [this message]
1991-12-11 21:48 ` Ronald S H Khoo
1991-12-12 12:16 ` David J. Fiander
-- strict thread matches above, loose matches on Subject: below --
1991-12-11 3:53 David J. Fiander
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=199112131247.3606.rc.badus@cs.su.oz.au \
--to=dhog@cs.su.oz.au \
--cc=rc@archone.tamu.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).