Skip to content

Conversation

ChrisRackauckas
Copy link
Member

No description provided.

@ChrisRackauckas
Copy link
Member Author

ChrisRackauckas commented May 24, 2022

@oschulz this is a bit of a tragedy. But there's a test that shows it's necessary, because of how this is implemented:

@generated function ArrayInterfaceCore.ismutable(::Type{<:ArrayPartition{T,S}}) where {T,S}
    res = all(ArrayInterfaceCore.ismutable, S.parameters)
    return :( $res )
end

which needs the dispatch for static arrays already defined for this to be resolved correctly, since it doesn't check the back edges.

@oschulz
Copy link

oschulz commented May 24, 2022

I guess that brings us back to the question "what would we need in a StaticArraysCore"?

@ChrisRackauckas ChrisRackauckas merged commit 8add4db into master May 24, 2022
@ChrisRackauckas ChrisRackauckas deleted the sa branch May 24, 2022 14:12
@oschulz
Copy link

oschulz commented May 24, 2022

which needs the dispatch for static arrays already defined

Sorry, I don't see it right now - which specialization is the critical one?

@ChrisRackauckas
Copy link
Member Author

Once again, this would only need SArray in there to know to mark it as ismutable false. So, the same little subset, nothing changed.

@ChrisRackauckas
Copy link
Member Author

Sorry, I don't see it right now - which specialization is the critical one?

ArrayInterfaceCore.ismutable(::Type{<:SArray}) = false is all.

@ChrisRackauckas
Copy link
Member Author

IMO, first push to Base should probably be to get that concept in Base. I don't know how people could write code without, it's insane that it still doesn't exist.

@oschulz
Copy link

oschulz commented May 24, 2022

Can't we just ask StaticArrays.jl to depend on ArrayInterfaceCore.jl and define it? :-)

@oschulz
Copy link

oschulz commented May 24, 2022

ArrayInterfaceCore.jl is so light now, so it would seem natural to define

ArrayInterfaceCore.ismutable(::Type{<:SArray}) = false

in StaticArrays.jl, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants