Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D4 two-arg Concat() failures #30

Open
duncand opened this issue Jun 27, 2017 · 1 comment
Open

D4 two-arg Concat() failures #30

duncand opened this issue Jun 27, 2017 · 1 comment

Comments

@duncand
Copy link
Contributor

duncand commented Jun 27, 2017

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.

@duncand
Copy link
Contributor Author

duncand commented Jun 27, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant