Philipp Gabler

Results 68 comments of Philipp Gabler

Ah, with your resolution I see now that the bar is actually a wave, in which case the distinction is much more prominent. Then it's not even me, but my...

That would be a nice idea if the purpose was to just work easier with it later, but it bites its own tail, since the `postwalk`ed function would itself need...

I noticed that at least you can match on `$` as an expression head, in theory: ```julia julia> @eval @capture expr $(Symbol("x_\$")) true julia> x :($(Expr(:$, :sdf))) ``` The problem...

Interesting. I see that for the interpolation variant of `@capture`, the difference is that the bindings are not assigned. Could `allbindings` be changed to make this work? I can't really...

I think the central issue is more that we're not taking `VarNames` seriously enough. Two months ago I was thinking about implementing a kind of trie- or R-tree-based dictionary, to...

Shouldn't that be an `eltype(v)` rather than `typeof(v)` in [`setindex`](https://github.com/jw3126/Setfield.jl/blob/94e905c96b050ec86ea4843d48e1bfe574fe3443/src/setindex.jl#L6)? ```julia julia> @code_warntype Setfield.setindex(μ, [0.0, 0.0], 1, 1:2) MethodInstance for Setfield.setindex(::Matrix{Float64}, ::Vector{Float64}, ::Int64, ::UnitRange{Int64}) from setindex(xs::AbstractArray, v, I...) in Setfield...

Thinking about it again, I think `eltype` is the wrong choice, too -- it would then fail for normal assignment of non-numbers that are now OK, like ```julia julia> Setfield.set([Some(1)],...

What about this: ```julia julia> @generated function select_type(v_type::Type{Tv}, v_eltype::Type{Tve}, I::Tuple) where {Tv, Tve} if any(ti function setindex(xs::AbstractArray, v, I...) T = promote_type(eltype(xs), select_type(typeof(v), eltype(v), Base.to_indices(xs, I))) ys = similar(xs, T)...

Not that much, I just figured that the minimum path to figure out whether we are assigning a slice is to check the "normalized" form from `to_indices` in that way....

I found this funny behaviour, reproducible in a fresh temp project with only OffsetArrays: ```julia julia> using OffsetArrays julia> A = rand(10, 10); julia> A[Base.Slice(1:10)] 10-element OffsetArray(::Vector{Float64}, 1:10) with eltype...