How about:


procedure p( expression1, expression2, ...)

where (1) argument is assigned *to the first variable* that occurs in expression and (2) if any one of expressions fail, runtime error.
It would require one ocurrence of the variable more for type conversion, but it is useful in wider variety of situations, and even one get contracts a la Eiffel for free. For example


procedure p(/var:=default)
procedure p(var:=integer(var))
procedure p( x>0, y>0)
procedure p( x>:=0)
procedure p( *L>0 )
procedure quadratic_equation( a~=0, b, c & ( b*b-4*a*c >=0 ) )
...

There is some asymmetry in assignement to the first variable, but it seems to be in spirit of Icon (like asymmetry of (x>y) in the case of success).


----
Kazimir Majorinc, Zagreb, Croatia

Reply via email to