GithubHelp home page GithubHelp logo

Comments (5)

Jollywatt avatar Jollywatt commented on May 27, 2024 1

You might have to be the one to open that StaticArrays issue, @aplavin — I've completely forgotten what this is all about!

from accessors.jl.

jw3126 avatar jw3126 commented on May 27, 2024

Thanks a lot for reporting! Broadcasting is tricky and not supported right now. Though I agree it would be nice to have. The

julia> @set s[2:3] += [100, 100] # slicing fails ungracefully
ERROR: StackOverflowError:

is a bug I would say. The ideal approach to fixing it would be to fix the following in StaticArrays.jl:

julia> Base.setindex(@SVector[1,2,3], [1,2], 1:2)
ERROR: StackOverflowError:
Stacktrace:
 [1] setindex(a::SVector{3, Int64}, x::Vector{Int64}, inds::UnitRange{Int64}) (repeats 79984 times)
   @ StaticArrays ~/.julia/packages/StaticArrays/6QFsp/src/deque.jl:198

and wait for this PR to land.
If you want to get this fixed faster I am happy to guide you.

from accessors.jl.

aplavin avatar aplavin commented on May 27, 2024

and wait for this JuliaLang/julia#46453 to land.

I don't think this is necessary. Just fixing StaticArrays setindex should be enough - it's just called in Accessors as is:

@inline setindex(a::StaticArrays.StaticArray, args...) = Base.setindex(a, args...)

from accessors.jl.

jw3126 avatar jw3126 commented on May 27, 2024

Ah thanks you are right @aplavin

from accessors.jl.

aplavin avatar aplavin commented on May 27, 2024

Broadcasting is now supported (Accessors#master, to be released soon)! All examples from the first post work on Vectors.
The remaining SVector issues are because of their setindex method that leads to StackOverflow - yes, it is still the case. When that is fixed, Accessors will support it without any further changes.
Would be useful if you opened an issue in the StaticArrays repo!

from accessors.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.