Conversation
|
There's some previous discussion under ocaml/ocaml#616, which included array literal disambiguation as part of a larger proposal that included various additional syntactic conveniences (e.g. allowing disambiguation for Regarding the current proposal: I'm in favour. The benefits are fairly limited, but it's forward-compatible with various more interesting things that we might want to do later (e.g. immutable arrays). |
|
Out of curiosity, I gave it a try: nojb/ocaml@c124bfa. Not sure if the approach is exactly right (comments welcome!), but worked well enough for an experiment: |
|
@nojb would you want to open a PR with that implementation? Maybe we can just get this one in. Thanks for taking a stab! |
| arrays](https://github.com/ocaml/ocaml/pull/13097), and I believe several people | ||
| have expressed a desire for compiler support for uniform arrays (which do not | ||
| participate in the float-array opimization). (This is just hearsay; I do not | ||
| have a reference.) Yet only `array` has first-class syntax, available both for |
Yes, I will open a PR soon and it can be discussed there. Thanks. |
See ocaml/ocaml#13340. |
|
This has now been merged in the compiler. Do we close? Do we merge this? I don't know the protocol. |
|
We don't have a good protocol for RFCs, the value is in the discussions I think. Merging would make sense, as it keeps a track record of RFCs we have accepted (in practice, if not formally). |
This RFC proposes extending the existing constructor-based type-directed disambiguation mechanism to array literal syntax, in both expressions and patterns. Right now, it would serve only to give literal syntax to
floatarrays, but other array constructs seem likely soon (such as immutable arrays or uniform arrays).