more on BCPL and C

lwa at mit-mrclean.ARPA lwa at mit-mrclean.ARPA
Thu Jun 28 11:51:00 AEST 1984


From:  Larry Allen <lwa at mit-mrclean.ARPA>

While we're on the subject of BCPL, I've always missed one of the BCPL
constructs which never found its way into C: the "valof-resultis"
construction.  This allowed any compound statement to return a value
and hence be used in an expression.  As I recall, the basic syntax
was something like:

	variable = valof {
		<statement list>
		resultis (result)
	}

and the statement list could contain declarations, etc.

This construction would be especially useful in conjunction with the
C preprocessor's macro capability, as it would allow one to build
macros with their own local variables and with moderately sophisticated
control structure.  One difficulty with imlementing it in C is that
the type of the result needs to be declared somewhere (not a problem
in BCPL!)

Any comments?
					-Larry Allen

PS. This is probably not the appropriate newsgroup for this, but from the
Internet it's the only one I get, so...



More information about the Comp.unix.wizards mailing list