Skip to content

Parser: allow seq_expr inside extended indexing/bigarray operators#1467

Merged
damiendoligez merged 3 commits intoocaml:trunkfrom
nojb:dotop_seq_expr
Nov 10, 2017
Merged

Parser: allow seq_expr inside extended indexing/bigarray operators#1467
damiendoligez merged 3 commits intoocaml:trunkfrom
nojb:dotop_seq_expr

Conversation

@nojb
Copy link
Contributor

@nojb nojb commented Nov 6, 2017

By analogy with the case of array and string indexing operators, the PR changes the parser so that the thing used inside extended indexing/bigarray operators is allowed to be a seq_expr instead of simply an expr. While this "feature" is surely not used much, the intent here is to keep the concrete syntax as uniform as possible.

@Drup
Copy link
Contributor

Drup commented Nov 6, 2017

This allows to write x.![1,2,3], right ? That is very useful, I'm surprised we missed that before. Could you add a test?

@Drup
Copy link
Contributor

Drup commented Nov 6, 2017

Answering to myself: No, it allows x.![ e ; e' ], which is arguably less useful.

@damiendoligez
Copy link
Member

Answering to myself: No, it allows x.![ e ; e' ], which is arguably less useful.

e might be a debugging statement, or some counter inserted by code instrumentation.

@gasche
Copy link
Member

gasche commented Nov 8, 2017

(of course foo.[(e; e')] is already valid today.)

The PR is just fine and the proposal is obviously reasonable, so I don't see any reason to argue against it. Unless someone finds an actual reason, I'll merge at some point starting next week. (Feel free to ping me if I forgot.)

Copy link
Member

@damiendoligez damiendoligez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approved. You'll need a Changes entry.

@nojb
Copy link
Contributor Author

nojb commented Nov 9, 2017

Changes updated. Thanks!

@gasche
Copy link
Member

gasche commented Apr 19, 2018

Unless there is dissent, I am going to revert this in the following days to leave space for maybe merging #1726 in some later point in the future.

@damiendoligez
Copy link
Member

@gasche ping

@gasche
Copy link
Member

gasche commented May 4, 2018

Thanks for the ping! I'm going to revert today. I hesitate between reverting from just 4.07 or also in trunk.

gasche added a commit to gasche/ocaml that referenced this pull request May 4, 2018
gasche added a commit to gasche/ocaml that referenced this pull request May 4, 2018
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
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

Successfully merging this pull request may close these issues.

4 participants