[comp.theory] Syntax for multiple output returns

markh@csd4.csd.uwm.edu (Mark William Hopkins) (09/11/90)

In article <11831@ogicse.ogi.edu> dinucci@ogicse.ogi.edu (David C. DiNucci) writes:
>...  The problem here is not *multiple out parameters*, but
>*textual syntax*...

This is a "problem" that I resolved a long time ago when developing my pet
language.  This language had a whole host of lovely features which virtually
made it unique in that it had simultaneously a purely functional reading and
a purely imperative reading and a pure data-flow reading (all, of course,
semantically equivalent).

A typical structured assignment statement would look like:

		  (A, B) := (B, A);

or 
		  (Quotient, Remainder) := Split(104, 10);

Of course, it also had structured constants: you really can't have structured
assignments without structured values as well.

>... A module
(in Large-Grain Data Flow 2)
> ...is a function where each argument is identified as in, out, inout, or
>neither (control flow only), and the graphical syntax shows the data flow
>clearly with arrows on one, both, or neither end of each arc representing an
>argument.  The symmetry between domain and codomain is preserved.

It also has this feature called a "virtual side-effect", which allowed you
to make transpositions according to equivalences like that below:

               (x, y) := f(x, z)  <--->  y := f(@x, z);
or even
			  @x + 1; <---> x := x + 1;

(eat your heart out C programmers :) ).  You could also declare a function
with an explicit virutal side-effect when one or more of its parameters was
preceded by the "@".  This had the effect of making it an "in-out" parameter.
All the predefined I/O functions were implicitly declared as such, thus making
them truly functional in the sense of functional programming as far as the
surface syntax went (but still imperative as far as the compiler went).  Of
course, they had to be called with the "@" as well...

It's name was Synthesis, because it purported to combine the best of all
the three above-mentioned programming paradigms, and was originally designed
to be a humorous but significant rebuttal to Backus.  However, no full
specification incorporating pointer semantics, modularity, or data hiding
consistent with the design goal was ever developed, nor was any compiler.
There were some close calls though...