According to the user guide:
parens(x) ::= "(<x>)"
main() ::= "<["a", "b", "c"]:parens()>"
works and actually does fine. But the following doesn't:
parens(x, y) ::= "(<x>, <y>)"
main() ::= "<["a", "b", "c"], ["1", "2", "3"]:parens()>"
The error says parens requires i0 and i. So the following works:
parens(x, y, i, i0) ::= "(<x>, <y>)"
main() ::= "<["a", "b", "c"], ["1", "2", "3"]:parens()>"
The same works with anonymous template as follows:
parens(x, y) ::= "(<x>, <y>)"
main() ::= "<["a", "b", "c"], ["1", "2", "3"]:{x, y | parens(x, y) }>"
If i and i0 are intended to be available only in anonymous subtemplates (the doc seems suggesting so),
then at least the behavior must be consistent across non-zipping and zipping cases.
In non-zipping case, i and i0 aren't required and even if we specify them, no indices are passed in.
But in zipping case, if we add i and i0 to the argument list, the proper indices are passed in.
That's weird to me.
UPDATE: I read Interpreter.java and for the zip_map, if (st.impl.isAnonSubtemplate) check around st.rawSetAttribute("i0", i0) seems omitted by mistake. rot_map and rot_map_iterator have one.
According to the user guide:
works and actually does fine. But the following doesn't:
The error says
parensrequiresi0andi. So the following works:The same works with anonymous template as follows:
If
iandi0are intended to be available only in anonymous subtemplates (the doc seems suggesting so),then at least the behavior must be consistent across non-zipping and zipping cases.
In non-zipping case,
iandi0aren't required and even if we specify them, no indices are passed in.But in zipping case, if we add
iandi0to the argument list, the proper indices are passed in.That's weird to me.
UPDATE: I read
Interpreter.javaand for thezip_map,if (st.impl.isAnonSubtemplate)check aroundst.rawSetAttribute("i0", i0)seems omitted by mistake.rot_mapandrot_map_iteratorhave one.