Description
The expression
%L
is desugared to
Percent(L)
Function Percent
@x:func Percent(L~xdom:element)~boolean | ||
|
Semantics
The percent function has special semantics for dealing with variable length parameter list. A function that takes a variable number of parameters has a single formal parameter whose name is preceded with a % prefix operator. When an actual parameter has the form %L, it is replaced by a sequence of positional and named parameters that come from the attributes of L.Examples
@x:func bar(%L) {
@x:for v := L {
v; ";"
}
}
@x:func foo(%L) {
bar(%L,
}
foo(1,
// result is: 1;2;3;abc;