JuliaArrays / JuliaArrays/StaticArrays.jl
Should Scalar(1) .+ 1 return 2 or Scalar(2)?
Open
Nobody has claimed this yet.
broadcast
design
- Dominant language
- Julia
- Stars
- 844
- Forks
- 159
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 3
Description
If was brought up here: https://github.com/JuliaLang/julia/pull/35591 that one nice property of Ref is that
julia> Ref(1) .+ 1
2
whereas
julia> Scalar(1) .+ 1
Scalar{Int64}((2,))
I'm not sure how I feel about this difference yet, but I figured I should open an issue to discuss it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked Julia PR #35591 and the current Scalar(1) .+ 1 behavior shown in the issue. Determine whether Scalar should match Ref by returning 2 or preserve Scalar wrapping; done requires a decided semantic direction and corresponding project changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100