-
Notifications
You must be signed in to change notification settings - Fork 3
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 considerations #25
Comments
on Julia 1.6 julia> (@fix Base.Broadcast.BroadcastFunction(+)(1, _))(1:3)
3-element Vector{Int64}:
2
3
4 |
Already true on v1.5, infix and prefix broadcasted functions parse differently: julia> dump(:(f.(1,2)))
Expr
head: Symbol .
args: Array{Any}((2,))
1: Symbol f
2: Expr
head: Symbol tuple
args: Array{Any}((2,))
1: Int64 1
2: Int64 2
julia> dump(:(1 .+ 2))
Expr
head: Symbol call
args: Array{Any}((3,))
1: Symbol .+
2: Int64 1
3: Int64 2 because julia> :(.+)
:.+
julia> :(f.)
ERROR: syntax: unexpected ")"
Stacktrace:
[1] top-level scope at none:1
julia> :(.f)
ERROR: syntax: invalid identifier name "."
Stacktrace:
[1] top-level scope at none:1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
because
Note that
Perhaps
Base.Broadcast.Broadcasted{Nothing}(+, ())
can be used to represent.+
, or we can define new wrapper type, or better yet just useBroadcastFunction
from JuliaLang/julia#37583The text was updated successfully, but these errors were encountered: