"Andy Glew" <glew@cs.wisc.edu> writes:
>a :=: b is cool,
>but I think that a,b := b,a
>or a := b, b := a
> (where , is the "parallel" separator for unordered code)
>is more general, and extends to arbitrary permutations:
POP-2 had this in 1968. Was this the first language with this feature?
The syntax was different, with the rvalue on the RHS:
a, b -> a -> b;
POP-2 had an explicit evaluation stack, but rvalues weren't stacked as
I recall - perhaps the reason for the assignment operator for each rvalue.
You could have fun with the explicit stack:
a,b; add(); # same as add(a,b)
->x ->y; x,y; # swap top 2 stack items
POP-2 also had a neat form of closures, called partial application, where
you could freeze in some function parameters into a new function.
mult(% 2 %) -> mult2;
mult2(3) -> six;
I've always been glad POP-2 was my first programming language.
--
Richard Wendland richard@starburst.demon.co.uk
|