Open
Description
Should @view
or @views
be extensible to other things besides ref
(getindex
) expressions? For example, @views
could change every function call f(...)
into:
maybeview(f::F, args...; kws...) = f(args...; kws...)
which packages could overload to add view support for their functions on selected argument types.
For example, as I commented in another #37367, numpy.flip
returns a view, which is much faster than explicitly computing reverse
and is sufficient for many if not all usages of reverse
; it might be natural for @views
to change reverse
calls on array arguments into view constructors.