Dispatch on enum

Impressium
Fri, 04 Mar 2022 12:53:22 +0000
General Usage

Hey all

Is it possible to dispatch a function on different enum instances.

Something like this:

julia> @enum E a b

julia> f(::Type{a}) = :a

julia> f(::Type{b}) = :b

julia> f(a)
:a

8 posts - 6 participants