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

rewrite_generic doesn't support splatting #184

Closed
odow opened this issue Nov 22, 2022 · 0 comments · Fixed by #185
Closed

rewrite_generic doesn't support splatting #184

odow opened this issue Nov 22, 2022 · 0 comments · Fixed by #185

Comments

@odow
Copy link
Member

odow commented Nov 22, 2022

julia> using MutableArithmetics; const MA = MutableArithmetics
MutableArithmetics

julia> x = [1, 2, 3]
3-element Vector{Int64}:
 1
 2
 3

julia> @macroexpand MA.@rewrite(+(x...))
quote
    #= /Users/oscar/.julia/dev/MutableArithmetics/src/rewrite.jl:321 =#
    let
        #= /Users/oscar/.julia/dev/MutableArithmetics/src/rewrite.jl:322 =#
        begin
            begin
                var"#5###278" = (MutableArithmetics.MutableArithmetics).Zero()
                var"#6###277" = (MutableArithmetics.MutableArithmetics).operate!!((MutableArithmetics.MutableArithmetics).add_mul, var"#5###278", x...)
            end
        end
        #= /Users/oscar/.julia/dev/MutableArithmetics/src/rewrite.jl:323 =#
        var"#6###277"
    end
end

julia> @macroexpand MA.@rewrite(+(x...), move_factors_into_sums = false)
quote
    #= /Users/oscar/.julia/dev/MutableArithmetics/src/rewrite.jl:321 =#
    let
        #= /Users/oscar/.julia/dev/MutableArithmetics/src/rewrite.jl:322 =#
        begin
            #= /Users/oscar/.julia/dev/MutableArithmetics/src/rewrite.jl:317 =#
        end
        #= /Users/oscar/.julia/dev/MutableArithmetics/src/rewrite.jl:323 =#
        x...
    end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant