rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* bugs with variable assignments
@ 1991-08-10 12:47 Solid Hogan
  0 siblings, 0 replies; only message in thread
From: Solid Hogan @ 1991-08-10 12:47 UTC (permalink / raw)
  To: The Rc Mailing List

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1991-08-10 12:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-08-10 12:47 bugs with variable assignments Solid Hogan

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).