Skip to content

Conversation

@T-Gro
Copy link
Member

@T-Gro T-Gro commented Sep 27, 2022

This PR extends the parser to support definition of types for multidimensional arrays.
Until now, only backtick syntax (e.g. int [,,,,] ) was supported.

Within this PR, backticks are no longer needed.

  • The backtick syntax int [,,,,]
  • syntax without backticks int [,,,,]
  • shorthand syntax array5d

Are the same type and are all supported.

The limitation of max. rank 32 is inherited by the limitation of System.Array, and the compiler will not allow int[.. 32 or more commas] as a type.

@T-Gro T-Gro linked an issue Sep 27, 2022 that may be closed by this pull request
0101
0101 previously approved these changes Sep 27, 2022
@T-Gro T-Gro self-assigned this Sep 27, 2022
@T-Gro
Copy link
Member Author

T-Gro commented Sep 29, 2022

@dsyme can I merge this?

@T-Gro T-Gro added this to the October-2022 milestone Oct 3, 2022
@T-Gro T-Gro removed the request for review from dsyme October 3, 2022 15:48
Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Feel free to ignore all the nitpicking - great job :)

@T-Gro T-Gro requested a review from dsyme October 7, 2022 18:10
@T-Gro T-Gro merged commit 79da721 into main Oct 10, 2022
@T-Gro T-Gro deleted the 12013-type-syntax-for-5d-6d-etc-arrays branch October 10, 2022 08:20
@dsyme
Copy link
Contributor

dsyme commented Oct 27, 2022

@vzarytovskii I guess this could have gone under a language version switch (though no real need to add now), and should count as an F# 7.0 feature.

@T-Gro Could you add a very very short RFC under https://github.com/fsharp/fslang-design/tree/main/FSharp-7.0 please? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Type syntax for 5d, 6d etc. arrays

6 participants