Skip to content
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

Add MScalar Type #591

Closed
wants to merge 3 commits into from
Closed

Conversation

willow-ahrens
Copy link
Contributor

@willow-ahrens willow-ahrens commented Feb 7, 2019

Why not also have an MScalar type? This also includes the zero dimensional broadcast fix from pja/zero-dim-broadcast. Perhaps this would help with #580?

@willow-ahrens willow-ahrens changed the title Pja/mscalar Add MScalar Type Feb 7, 2019
@tkoolen
Copy link
Contributor

tkoolen commented May 2, 2019

This appears to introduce an ambiguity on 1.0.3. Do you still care about this?

@timholy
Copy link
Member

timholy commented May 2, 2019

Also worth pointing out #518

@willow-ahrens
Copy link
Contributor Author

While I think these changes might provide some nice symmetry with the "Scalar" type, I mostly wanted to fix indexing for zero-dimensional MArrays, which I think happened in #581.

@andyferris
Copy link
Member

I suppose we could add this, for symmetry as noted. On the other hand, many use cases are well covered by RefValue or the immutable Scalar - which, really, only existed to help me do some broadcasting tricks (does Base recommends Ref for that now?).

(On a side note, I'm still curious whether something will shake out of the references work (that Keno is interested in) that covers the broadcast-as-a-scalar case, too)

@c42f
Copy link
Member

c42f commented Jul 13, 2019

I think we should close this and direct people to use Refs or 0-dimensional MArrays if that covers the desired use cases. (I'm somewhat inclined to deprecate Scalar for similar reasons.)

@andyferris
Copy link
Member

Yes, it's tempting to do as Chris says and just leave this.

(I always hoped for an alias to appear in Base for Array{T,0}, which we would then mimic, but there has been no successful argument for that yet).

@c42f
Copy link
Member

c42f commented Jul 16, 2019

Ok, I'll close this for now. However, if you do find a need for MScalar which is not covered by the existing types I'm completely happy to reconsider.

@c42f c42f closed this Jul 16, 2019
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.

5 participants