Open MilesCranmer opened 3 months ago
Actually changed my mind... A readonly
function is better than a macro. But I think an easy to use function for MyArrayType{T,N} -> ReadOnlyArray{T,N,MyArrayType{T,N}}
would be a huge help for readability.
How would you want the function to work (i.e. how would it be different from what we have now with ReadOnlyArray
)?
ReadOnlyArray
is okay for construction, albeit a bit verbose.
The more useful thing is the type alias. It’s very wordy to type out the whole parametrized ReadOnlyArray.
Just wondering if anybody would be interested in the following macro @bkamins @markmbaum?
A function would be fine too of course; it just feels a bit more appropriate as a macro due to the behavior as both an operation on types and on instances.
The use-cases are as follows:
I've got it as an internal macro but I could just upstream it here if interested.