Nevin wrote

However, this does point out a problem with the syntax. Is

F(..., x := x + 1, ...)

invoking call by name on the parameter x, or is it incrementing x by 1 and passing that in positionally to F?

Each call of the described macros sets x to &null so meaningful use of x as parameter name and variable in the same time is impossible; that looks OK to me, one just need to accept that parameter names cannot be used in other purposes. Solution for few cases where it cannot be done you already gave in your "overhead" example.


---------
There is another way, using tables and macros again.

#ugly but once
$define pars T:=table() &
$define let T[name(
$define is )]:=
$define pend &T
$define pars_by_name (T);every variable(s:=key(T)):=T[s]

#pretty and forever
procedure f pars_by_name
        write("x^2:=",x^2)
        write("y^2:=",y^3)
        end

procedure main()
  write( f( pars let y is 3 & let x is 12 pend) )
end





----
Kazimir Majorinc, Zagreb, Croatia

Reply via email to