Broadcast over . (getfield) in 0.6

For broadcasting, you need one of two forms, for functions f in general you do f.(args...) or use dot operators, e.g. a .+ b. The problem here is that . (dot) by itself is not an operator, so there can’t be a dot operator version for it.

If you want a compact form you could still define your own operator, though. E.g.

↦(s, f) = getfield(s, f)
pairs .↦ :a
pairs .↦ 1
5 Likes