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

Separate all operation arguments by commas #33

Open
Garados007 opened this issue Jul 28, 2023 · 0 comments
Open

Separate all operation arguments by commas #33

Garados007 opened this issue Jul 28, 2023 · 0 comments

Comments

@Garados007
Copy link
Member

Igor Pro allows omitting the comma at certain argument positions for operations and does allow extraneous commas before the first argument. For example:

// omitting a comma
printf "x=%d, y=%d" 1, 2
sprintf msg, "x=%d, y=%d" 1, 2
// extraneous comma
printf , "text"

I would consider this as bad coding style and propose that all arguments must be separated by exactly one comma and no commas are allowed before or after the argument list.

printf "x=%d, y=%d", 1, 2
sprintf msg, "x=%d, y=%d", 1, 2
printf "text"

Impact

There is a large code base with lots of these coding style errors, so I wouldn't suggest reporting this to WM and fixing their compiler. I couldn't find any case for which fixing the comma leads to a compile error in Igor Pro.

Garados007 added a commit to byte-physics/igor-code-browser that referenced this issue Jul 28, 2023
Igor Pro does allow omitting the comma between the first and second
argument of an operation and also allows adding extranous commas before
the first argument.

This isn't considered as good coding style [1] and allowing this does
also makes the Igor grammar [2] more complicated than needed.

[1]: byte-physics/igor-pro-coding-conventions#33
[2]: https://gitlab.byte-physics.de:4001/internal/common-orga-and-tools/-/issues/237
Garados007 added a commit to byte-physics/igortest that referenced this issue Jul 28, 2023
Igor Pro does allow omitting the comma between the first and second
argument of an operation and also allows adding extranous commas before
the first argument.

This isn't considered as good coding style [1] and allowing this does
also makes the Igor grammar [2] more complicated than needed.

[1]: byte-physics/igor-pro-coding-conventions#33
[2]: https://gitlab.byte-physics.de:4001/internal/common-orga-and-tools/-/issues/237
Garados007 added a commit to byte-physics/igortest that referenced this issue Jul 28, 2023
Igor Pro does allow omitting the comma between the first and second
argument of an operation and also allows adding extranous commas before
the first argument.

This isn't considered as good coding style [1].

[1]: byte-physics/igor-pro-coding-conventions#33
Garados007 added a commit to byte-physics/igor-code-browser that referenced this issue Jul 28, 2023
Igor Pro does allow omitting the comma between the first and second
argument of an operation and also allows adding extranous commas before
the first argument.

This isn't considered as good coding style [1].

[1]: byte-physics/igor-pro-coding-conventions#33
Garados007 added a commit to AllenInstitute/MIES that referenced this issue Jul 28, 2023
Igor Pro does allow omitting the comma between the first and second
argument of an operation and also allows adding extranous commas before
the first argument.

This isn't considered as good coding style [1].

[1]: byte-physics/igor-pro-coding-conventions#33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant