This file describes feeping creaturism in rc; changes that have been
made to rc that make it differ from Tom Duff's description in the Unix
v10 manuals.


IF--ELSE: the syntax of "if" has been modified so that now an else
clause permitted; see the discussion in INTRO. This should be the only
serious backward-compatability break with AT&T rc. However, it is my
understanding that Tom Duff also plans to change the "if not" command
to something else, so we are not really losing anything here by
changing it ourselves.

BACKQUOTE: braces are not mandatory if the argument to a backquote is
just one word. So, we have:

	echo `src

instead of

	echo `{src}

BACKGROUND JOBS: rc sets the process group to the child process in a
backgrounded task so that signals from the parent do not pass to the
child. This was necessary because so many programs out there assume
csh. This only applies to Berkeley-derived machines.

FLAT LISTS: there is no easy way to do 'string'$var'string' and not
have the automatic concatenation of lists occur if $var has many
elements. The only way to do it in classic rc is to do:

	ifs=() 'string'`{echo -n $var}^'string'

This has been accomodated in new rc with the "$^" operator; $^foo
refers to a single element list comprised of all the elements of $foo
space-separated.

NULL LISTS: concatenation with null lists is not reported as an error;
the null list is treated as the identity element under list
concatenation:

	()^$foo == $foo^() == $foo

Also, I'm not sure if plan 9 rc allows this, but pattern matching
against the null list is allowed:

	if (~ $foo ())

tests to see if $foo is null.

HEREDOCS: In order to facilitate using heredocs inside functions, the
concept of a "herestring" has been introduced:

	cat <<< 'this is a test
	'

produces the output:

	this is a test

Thus, heredocs inside functions are implicitly translated into
herestrings, and so can be safely exported into the environment. Of
course, the herestring may also be used interactively, for whatever
it's worth. Remember to quote single quotes in the body text.

RETURN and BREAK: do the obvious thing.

	return n

returns with status n (optional) from a function. break breaks out of
the innermost for or while.

ECHO: has been built in to the shell for performance. Supports a very
primitive echo implementation:

	echo -n

omits the trailing newline,
while

	echo --

disregards further options to echo; thus

	echo -- -n

will echo 

	-n

to the standard out.
