rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Paul Haahr <haahr@jivetech.com>
To: Decklin Foster <fosterd@hartwick.edu>
Cc: rc@hawkwind.utcs.toronto.edu
Subject: Re: rc futures
Date: Fri, 31 Dec 1999 23:20:54 -0500	[thread overview]
Message-ID: <cUvlaC7Mb1l@iadd.jivetech.com> (raw)
In-Reply-To: <20000106224609.B19379@dillinja>

Decklin Foster wrote:

> > 5. Builtin `echo'.  Well, it's not going away :-). There's always the
> > compile-time option to omit it...
> 
> We could always make echo an optionally-compile-inable builtin /a la/
> the stuff in addon.c, and make the people who want it figure out how
> to have it be linked in... ;-) Not that *hard*, just annoying.

No.  Adding compile-time options is always worse.


> > 10. `$PATH' versus `$path'.  I think rc should prefer `$path' if both
> > are set.  Likewise for `$cdpath' and `$home'.
> 
> Ooops. I thought, from reading the manpage, that rc updated $PATH if
> something set $path and vice versa? I guess this must not be the case.

It does the right thing.  Play with it for a second to see:

  ; path = a b
  b not found
  ; path = (a b)
  ; echo $PATH
  a:b
  ; PATH=x:y
  ; echo $path
  x y
  ; 


> > 17. Improved error reporting, as discussed on the list recently.  Also,
> > I intend that rc should prefix its errors with `rc: '; the long standing
> > Unix tradition that shells are special in this regard is not very
> > useful, I think.
> 
> Great. However, I went to go try to add this and discovered print.c.

Adding it to print.c would be problematic, I think, because there's no
distinguished function for printing errors.  (I believe es uses eprint
for that purpose.)  And the important part, source file name and line
number, requires understanding the somewhat more subtle stuff going on
in input.c.

> I must admit that i'm entirely lost in it. It *seems* to be a copy of
> fprintf. Are we actually trying to be portable to systems without a
> printf? :-)

That code is my fault, if I remember properly.  Byron and I were taken
with the notion of the Plan 9 print() and fmtinstall(), and used that
model pervasively.  In particular, function exporting depends on the %T
conversion rules -- see footobar.c:Tconv().

Other difference with the stdio printf family (aside from letting you
install your own formatters), include that it works directly with file
descriptors and is unbuffered.

As to excesses in the NIH department, I'm pretty sure rc used to ship
with its own malloc(), too.  (Sun's malloc was very slow at one point.)

> But seriously, there are some entry points which deal with this Format
> structure that i'm not sure of the significance of...

I suspect you're looking at mprint() which returns a string containing
the formated output, allocated with malloc(), and nprint(), which does
the same with nalloc() allocated memory.


> > 18. Support BSD editline, and clean up the readline, editline, vrl, etc.
> > interface if possible.  (Suggestion due to Raymond Venneker.)
> 
> also a more (intellegent, bloated, take your pick... ;-)) readline
> interface. with bash readline can look inside variables and complete
> against $PATH if it's the first word, and so on... If I can figure out
> how to help with #17 and it gets fixed then I'll take a look at this.
> Don't worry, i'll ask if I have to add anything *really* fattening.

I thought making getenv do the right thing was most of the battle here.


> > 20. ~ expansion.
> 
> I am, of course, biased for this, if only because I haven't actually
> used ~ for matching in a script yet... Here's my question. Is there
> really anything about '~' (the builtin) that can't be done with an
> external program? Why does it get a special glyph indtead of a name
> like 'match'? I never use '[' for 'test' when i'm using rc...

It got a special character because Tom Duff said it did.  But it can't
be confined to an external program because it uses the globbing rules,
so it needs to distinguish between, say, unquoted * and quoted '*'.

> Obviously, you can argue that there's nothing at all essential about
> using ~ to denote $home, but you have to make a tradeoff somwhere.

It can easily do both.  It does in es, and in several rc variants people
have hacked up.

--p


  reply	other threads:[~2000-01-13 22:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-10 16:55 Tim Goodwin
1999-12-13 18:54 ` Paul Haahr
2000-01-04 16:43   ` Tim Goodwin
1999-12-31 23:26     ` Paul Haahr
1999-12-15  0:17 ` Chris Siebenmann
2000-01-07  3:45 ` Decklin Foster
2000-01-01  4:20   ` Paul Haahr [this message]
2000-01-15  8:58     ` Steve Kilbane
1999-12-13 12:55 Elliott Hughes
1999-12-14  9:44 Byron Rakitzis
1999-12-15 16:32 Russ Cox
1999-12-16 12:43 Smarasderagd
1999-12-19 11:06 ` Steve Kilbane
1999-12-22  0:00   ` Christopher Vance
1999-12-16 16:40 Chet Ramey
2000-01-03 15:46 Bengt Kleberg
2000-01-12 14:22 Bengt Kleberg
2000-01-12 21:34 Chet Ramey
2000-01-01  2:55 ` Paul Haahr
2000-01-14 12:16 Bengt Kleberg
2000-01-14 12:20 Bengt Kleberg

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=cUvlaC7Mb1l@iadd.jivetech.com \
    --to=haahr@jivetech.com \
    --cc=fosterd@hartwick.edu \
    --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).