Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!harvard!godot!mit-eddie!smh
From: smh@mit-eddie.UUCP (Steven M. Haflich)
Newsgroups: net.lang.c
Subject: Re: Concurency in C
Message-ID: <3371@mit-eddie.UUCP>
Date: Mon, 31-Dec-84 10:54:39 EST
Article-I.D.: mit-eddi.3371
Posted: Mon Dec 31 10:54:39 1984
Date-Received: Tue, 1-Jan-85 06:08:35 EST
References: <6856@brl-tgr.ARPA>
Reply-To: smh@mit-eddie.UUCP (Steven M. Haflich)
Organization: MIT, Cambridge, MA
Lines: 31

In article <6856@brl-tgr.ARPA> Bob Larson  writes:

>2) {{ and }} bracket a set of concurrently executed statements, that
>may be executed concurrently or sequentially in any order.  The compound
>statement thus formed will be considered terminated only when all statements
>inside it have been completed.

The {{ ... }} construction can usefully appear in existing C code, for
instance, to localize and economize register allocations:

	/* Clean up once a week. */
	if (Thursday) {
		{	register struct hearth *ph;
			for (ph = fireplaces; *ph; ph++) clean_hearth(ph);
		}
		{	register struct oven *po;
			for (po = ovens; *po; po++) clean_oven(po);
		}
	}

Here the compiler cannot figure out what kind of bracket it has until it
sees the second inner compound statement.  If you intend the
two-character token to be lexigraphic (i.e. `{{' without intervening
whitespace) rather than syntactic, it is less of a problem, but still I
would resist adding any new fuzziness to the boundary between C's lexer
and parser.  We should have learned from "lvalue=-value".

I could suggest `{[' and `]}', since `[' cannot legitimately (I think)
start a statement, and the proper pairing a `]}' sequence with either
separate `{' and `[' or a single `{[' can unambiguously be determined
from the parse stack.  Unfortunately, this punctuation is visually ugly.