Y
Hacker News
new
|
ask
|
show
|
jobs
by
oxinabox
1778 days ago
Why does Javis use `act!(object, action)` rather than making actions callable structs so you could do `action(object)` ?
2 comments
Mageek
1777 days ago
Julia is not object-oriented. If you want to dispatch on the type of action, you include it in the method signature.
link
DNF2
1777 days ago
Actually, callable structs are a common pattern in Julia, and are not in opposition to multiple dispatch.
You are probably thinking of dot-method syntax, like this
object.action()
link
StefanKarpinski
1777 days ago
Might make it easier to dispatch on both the object and the action? Just a wild guess.
link
oxinabox
1776 days ago
Right, can't to abstract callable overloads in older versions of julia
link