Consider the following test module
----------
module parse-test
imports tuple-cons list-cons list-basic list-misc term-io
strategies
main = <aux-InlineFun(|"foo", [1, 2], ("foo", [1, 2]))> ("g_0", ["x","y"], (4,3), 2)
rules
aux-InlineFun(|f, t*, h_0):
("g_0", v*, t, nargs) -> 37
where debug(!"matched LHS: ");
!t*; debug(!"built listvar from term arg: ")
----------
Now running it, gives unexpected behaviour:
[
adam@madras:misc]$ ./parse-test
matched LHS: ("g_0",["x","y"],(4,3),2)
./parse-test: rewriting failed
The term argument parses as a DefaultVarDec("t*") as expected, the !t* parses as Build(Var(ListVar("t*"))), but this building fails.
The reason is that Var(ListVar("t*")) is not known at all within the rule-body (I can even match it against any fresh term).
Should we fix the availability of t*, or not? In this latter case, we may need to reject listvar-ids as term arguments, but that's not very elegant either.
(When introducing local var scope of a ruledef, <diff> (<tvars> r, y') was used, but should have been <diff> (<tvars; map(try(?ListVar(<id>))> r, y')