Skip to content

Broadcasting over binary functions #40

Open
@cstjean

Description

@cstjean

I'm a bit confused by the broadcasting behaviour outlined below. Admittedly, I don't understand the broadcasting machinery, but shouldn't all of these examples (ideally) return Fill objects?

julia> using FillArrays

julia> f(x) = x
f (generic function with 1 method)

julia> g(x, y) = x
g (generic function with 1 method)

julia> f.(Fill(1, 2))   # good
2-element Fill{Int64,1,Tuple{Base.OneTo{Int64}}}:
 1
 1

julia> g.(Fill(1, 2), 3)   # ok
2-element Fill{Int64,1,Tuple{Base.OneTo{Int64}}}:
 1
 1

julia> g.(Fill(1, 2), "a")   # why not a Fill output?
2-element Array{Int64,1}:
 1
 1

julia> g.(Fill(1, 2), Ref(2))
2-element Array{Int64,1}:
 1
 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions