Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
oxinabox
on Aug 1, 2021
|
parent
|
context
|
favorite
| on:
Javis.jl – Julia Animations and Visualizations
Why does Javis use `act!(object, action)` rather than making actions callable structs so you could do `action(object)` ?
Mageek
on Aug 2, 2021
|
next
[–]
Julia is not object-oriented. If you want to dispatch on the type of action, you include it in the method signature.
DNF2
on Aug 2, 2021
|
parent
|
next
[–]
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()
StefanKarpinski
on Aug 2, 2021
|
prev
|
next
[–]
Might make it easier to dispatch on both the object and the action? Just a wild guess.
oxinabox
on Aug 2, 2021
|
parent
|
next
[–]
Right, can't to abstract callable overloads in older versions of julia
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: