D4 two-arg Concat() failures
Compare the following D4 expressions:
Exhibit A: select System.TableVars add {Name.Value x} group add {Concat(",", x order by {x}) y}
Exhibit B: select System.TableVars add {Name.Value x} group add {Concat(x order by {x}, ",") y}
The first version will produce output like ,Foo,Bar,Baz, while the second version will fail to parse with the error message Application:102104 ---> ")" expected. Syntax error near ","..
Normally I would expect there to be a 2 argument form of Concat where the non-list argument specifies the delimiter between elements of the list element, but in one sense either the reverse has happened, or leading and trailing commas have also been added.
The behaviour is counter-intuitive either way. In Exhibit B, I would expect not a syntax error but rather an error citing no matching operator signature, if that is the case. In Exhibit A I would expect no leading or trailing comma.
Following up, select Concat(list(String){'29','x','42'},",") works as expect and has just the 2 commas between the 3 elements, where select Concat(",", list(String){'29','x','42'}) fails to match a routine signature; thus there is inconsistency between the table and list versions of Concat.