Skip to content

Commit

Permalink
Added elementwise version of => to prec-pair (#27447)
Browse files Browse the repository at this point in the history
* Added  elementwise version of => to prec-pair

* Added test for broadcasting pair operator

* Update broadcast.jl

* Update broadcast.jl

* Delete whitespace

* Added NEWS entry on broadcasting pair operator

* Fixed spruious deletion in NEWS.md
  • Loading branch information
MasonProtter authored and StefanKarpinski committed Jun 9, 2018
1 parent c9b2274 commit 2a45839
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ New language features
* Keyword arguments can be required: if a default value is omitted, then an
exception is thrown if the caller does not assign the keyword a value ([#25830]).

* The pair operator `=>` is now broadcastable as `.=>` which was previously a parsing error ([#27447])

Language changes
----------------

Expand Down
2 changes: 1 addition & 1 deletion src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(append! (add-dots '(= += -= *= /= //= |\\=| ^= ÷= %= <<= >>= >>>= |\|=| &= ⊻= ≔ ⩴ ≕))
'(:= ~ $=)))
;; comma - higher than assignment outside parentheses, lower when inside
(define prec-pair '(=>))
(define prec-pair (add-dots '(=>)))
(define prec-conditional '(?))
(define prec-arrow (append!
'(-- -->)
Expand Down
7 changes: 7 additions & 0 deletions test/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,13 @@ let f(args...) = *(args...)
@test f.(x..., f.(x..., y, z...), y, z...) == broadcast(f, x..., broadcast(f, x..., y, z...), y, z...) == 120*120
end

# Issue #27446: Broadcasting pair operator
let
c = ["foo", "bar"]
d = [1,2]
@test Dict(c .=> d) == Dict("foo" => 1, "bar" => 2)
end

# Broadcasted iterable/indexable APIs
let
bc = Broadcast.instantiate(Broadcast.broadcasted(+, zeros(5), 5))
Expand Down

5 comments on commit 2a45839

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

@ararslan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done some stuff, let's see if it did anything. @nanosoldier runbenchmarks(ALL, isdaily=true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

@ararslan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I've added StatsBase on all of the worker nodes, so I'm not sure what the deal is...

Please sign in to comment.