rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: culliton@srg.af.mil (Tom Culliton x2278)
To: rc@hawkwind.utcs.toronto.edu
Subject: Re: Thoughts on a builtin read
Date: Tue, 21 Sep 1993 11:54:45 -0400	[thread overview]
Message-ID: <9309211154.aa16146@ceres.srg.af.mil> (raw)

Oh, where to start....

Rich is right about the patch for nalloc.c, his version is better style.

For Malte, simplicity is often the same as usability, it takes a lot
fewer brain cells to remember and correctly use something simple vs.
something complex.  Maybe I'm just getting old, but I find myself
running low on brain cells pretty regularly these days.  What really
convinced me that rc's read should be simple was looking at the one in
ksh.  What a monstrosity! 8-P

The other idea that Malte mentioned, having read act like line, does
have a certain appeal.  It's may even be cleaner because it doesn't add
another way of setting variables.  And as Alan points out, a simple
function can easily convert one form to the other.  The only problem is
that you always need a `{} and thus an extra fork to do anything with
it.  

For Chris, if you don't care about setting a different ifs, you can 
split the line without a fork by using eval:
	read x;eval 'x=('$x')'
Of course if you want to split up the fields of /etc/passwd on ':'
you'll still need to fork.  Producing your own version of read, that
splits the input line using ifs, should be easy if you generalize the
backquote code in glom.c.  Go for it! ;-)

Finally, Alan has given me the go ahead to repost his version of read as
a patch.  The current version doesn't support readline yet, so maybe
I'll try to hack that in after lunch.

Tom


             reply	other threads:[~1993-09-21 17:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-21 15:54 Tom Culliton x2278 [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-22 17:18 Steve_Kilbane
1993-09-21 17:26 Arnold Robbins
1993-09-21 17:11 rsalz
1993-09-21 16:58 Arnold Robbins
1993-09-21 16:52 gjv%atlas%cesar
1993-09-21 16:36 Byron Rakitzis
1993-09-21 16:50 ` Chris Siebenmann
1993-09-21 15:56 malte
1993-09-21 17:02 ` Chris Siebenmann
1993-09-21 15:15 Alan Watson
1993-09-21 15:09 rsalz
1993-09-21 14:33 malte
1993-09-21 14:20 rsalz
1993-09-21  6:51 malte
1993-09-21 14:19 ` Chris Siebenmann
1993-09-20 22:11 Tom Culliton x2278

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=9309211154.aa16146@ceres.srg.af.mil \
    --to=culliton@srg.af.mil \
    --cc=rc@hawkwind.utcs.toronto.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).