Thanks! We definitely want to hear from end users on topics like this.
I like array[N] matrix[I, J]
more otherwise, but as @Bob_Carpenter said, it would be inconsistent with declaring an array of reals etc. Moreover, I think array
is neither a keyword in Stan or a reserved keyword, so wouldnāt this change potentially break some old code? So I voted for matrix[I, J][N]
. For the type specifiers in function arguments I would like to have
-
matrix[]
ifmatrix[I, J][N]
is the variable declaration -
array[] matrix
ifarray[N] matrix[I, J]
is the variable declaration
I think we would have array declarations be consistent across all types, I was just using matrix as an example, sorry I should have been clear about that when I made the poll.
Good point about making array
a reserved keyword. Iām not sure how big of an issue thatāll be. (It should be possible to not make it a reserved keyword but weād probably have to mangle the parser a bit.)
Finally got around to reading the whole thread - why didnāt the 2nd poll have `matrix[N][I, J] either? haha, oh well.
I guess OCaml does this, though itās got to have the most backwards (literally) version Iāve seen - the type int option list
is a list of options of ints, like [Some 1, None, Some 2]
. But it does seem to be expressive enough for them so far.