the.bay.news

Order-agnostic dispatch

Julia Programming Language
Order-agnostic dispatch
Let’s say I have a function like: function f(x::TypeA, y::TypeB, z::TypeC) ... end For this particular function f it does not matter what the order of the arguments is, meaning f(x::TypeA, y::TypeB, z::TypeC) == f(::TypeB, y::TypeC, z::TypeA) == f(::TypeC, y::TypeA, z::TypeB) etc. How can I make f work on every combination of arguments without having to write out every single one by hand? Dispatching on a single abstract type would not work because f could have multiple methods, each opera...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.