1 - Can we have a macro that returns a macro? I suppose no.
I don't understand this, because macros don't "return" anything.
I wanted a macro like:
Macro(a,b) = Test(x) == x.out = a /\ x.in = b
That way I could write later:
SelectSeq(u, Macro(1,2))
2 - In pcal the variables generated by the parameters of the
procedures appears after the macros, it is unfortunate.
I don't understand this, because the variables I believe you are
talking about are part of the TLA+ translation, and the macros are in
the PlusCal source.
The translation generates:
Variables x, y, z
A == ...
B == ..
Variables a, b, c (* a b c are procedures parameters*)
I think it would be better if we had
Variables x, y, z, a, b, c
A == ...
B == ..
Because that way one can use a b c in the macros.
I don't know of any programming language that lets you test a
procedure; they only let you test a program that calls the procedure.
It is often unfortunate by the way. Because definitely we often needs to test procedure in isolation.
Obvioulsy there are workaround. That's true. But it's not as good.
Thank you, Leslie, for your comments.
--
FL