Re:Javis.jl – Julia Animations and Visualizations
by oxinabox on Sunday August 01, 2021 @03:27PM
(#28029093)
Why does Javis use `act!(object, action)`
rather than making actions callable structs so you could do
`action(object)` ?
[ Parent
| on HN ]
Re:Javis.jl – Julia Animations and Visualizations
by Mageek on Monday August 02, 2021 @01:52AM
(#28033313)
Julia is not object-oriented. If you want to dispatch on the type of action, you include it in the method signature.
Re:Javis.jl – Julia Animations and Visualizations
by DNF2 on Monday August 02, 2021 @10:15AM
(#28036789)
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()
Re:Javis.jl – Julia Animations and Visualizations
by StefanKarpinski on Sunday August 01, 2021 @09:53PM
(#28032110)
Might make it easier to dispatch on both the object and the action? Just a wild guess.