-
Notifications
You must be signed in to change notification settings - Fork 38
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
Broadcasting over binary functions #40
Comments
This should be an easy fit: just need to override |
Can I ask for some more help please? I'm stumbling in the dark. I have struct FillStyle{N} <: AbstractArrayStyle{N} end
Base.BroadcastStyle(::Type{<:AbstractFill{T, N}}) where {T, N} = FillStyle{N}()
(::Type{<:FillStyle})(::Val{N}) where N = FillStyle{N}()
Base.BroadcastStyle(::FillStyle{N}, ::AbstractArrayStyle{0}) where N = FillStyle{N}() But I'm getting missing methods and ambiguities. I can fix those, I suppose, but is that what you had in mind? I just don't get the broadcasting machinery. |
Ah, I forgot there's no |
I don't know what to do with this one:
|
Broadcasting has different levels of overriding, see https://docs.julialang.org/en/v1/manual/interfaces/#man-interfaces-broadcasting-1. For immutable types you want to override at a lower level: that is, override |
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?The text was updated successfully, but these errors were encountered: