Skip to content

Update convert.jl #740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

githubtomtom
Copy link
Contributor

supports promote() to SArray

@andyferris
Copy link
Member

OK, this is pretty interesting - what is the desired behavior here? That operations like SVector(1,2,3) + [1,2,3] returns an SVector? Or manual usage of promote?

I note that promote was designed for Number and operations such as * can invoke automatically promote - while the definitions here might not make great sense for that case. Also, should the length be checked to be compatible, or the size, or the axes (remembering we are coming from AbstractArray)?

@githubtomtom
Copy link
Contributor Author

githubtomtom commented Feb 19, 2020 via email

@c42f
Copy link
Member

c42f commented Feb 21, 2020

actually I was try to do SVector(1,2,3) .+ [1,2,3] (broadcasting) returning a SVector

Oh right! great to know thanks.

In that case I suggest we fix broadcasting rather than messing with promote which is generally for use with scalars. Unfortunately it may not be simple; the broadcasting machinery is already quite complex.

@c42f
Copy link
Member

c42f commented Feb 21, 2020

I've created #744 to track fixing broadcast as I think that's the correct way to fix your underlying issue.

@c42f c42f closed this Feb 21, 2020
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.

3 participants