rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Solid Hogan <dhog@cs.su.oz.au>
To: The Rc Mailing List <rc%archone.tamu.edu@munnari.oz.au>
Subject: bugs with variable assignments
Date: Sat, 10 Aug 1991 07:47:24 -0500	[thread overview]
Message-ID: <9108102247.12224.rc.bader@cs.su.oz.au> (raw)

In the process of changing to 1.1gamma, we've found some surprises.
It's probably at least a bit fair to call some of them bugs.

One of the things that makes rc much better than other shells
is the fact that it has true local variables: if you want a
variable to be declared for a local scope, you just

	var=() {
		any code
		you like
	}

and the variable will be saved and restored around the local use.
This is great.

Now, it was a little surprising that this actually failed if there
were nothing but an assignment in the block:

	frag = /a/very/long/pathname/fragment {
		global = ($frag/sub1 $frag/sub2 $frag/third/sub)
	}

never worked (it always left frag set, instead of making the
assignment local).  But in earlier rc's, you could write:

	frag = /a/very/long/pathname/fragment {
		global = ($frag/sub1 $frag/sub2 $frag/third/sub) ;
	}

and it would work.  We're not quite sure where it changed, but it
definitely worked in 1.0.  In 1.1gamma, this no longer works; to get
it to be a local assignment now takes something like:

	frag = /a/very/long/pathname/fragment {
		global = ($frag/sub1 $frag/sub2 $frag/third/sub) true
	}

which is pretty ugly.


                 reply	other threads:[~1991-08-10 12:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=9108102247.12224.rc.bader@cs.su.oz.au \
    --to=dhog@cs.su.oz.au \
    --cc=rc%archone.tamu.edu@munnari.oz.au \
    /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).