Assignment in Conditionals

Peter DaSilva peter at kitty.UUCP
Sat Aug 10 03:00:05 AEST 1985


> There is no reason why assignment should not return a value. LISP & APL
> both do. An experienced programmer in either language can handle that.
> In LISP, even conditionals & loops return values, & I see no reason why
> they couldn't have been designed that way in C.

In the language 'C' is rumored (:->) to have developed from, they do. In
BCPL any block can return a value:

	FOO = $( ...
		 RESULTIS <expr> $) (or is that )$???)

You can also do this:

	foo(table 1,5,7,9)

Which is the equivalent of

int *tmp={1, 5, 7, 9}

	foo(tmp)

I wish 'C' kept both of these. I can do without the weird TEST/IF/UNTIL/WHILE...
control structures, though. Hell, even auto-initialise aggregates other than
strings would be ok.


I know. The language purists are going to shoot me. (hides behind copy of
"BCPL, the language and it's compiler" (Richards & Whitby-Stevens, Cambridge
University Press, 1980)



More information about the Comp.lang.c mailing list