My Julia code uses many different kinds of MutableNamedTuples e.g.
box = MutableNamedTuple
CSV(file::String) = box(rows=[], file=file)
NUM() = box(n=0,mu=0, sd=0, m2=0)
I want to dispatch methods on the different kinds of MutableNamedTuples.
But how do I do that?
Is it possible to generate subtypes of MutableNamedTuples?
Or is there a different approach I should take?
(Ideally, one as succinct as using MutableNamedTuples but I'll take anything, with thanks.)
You can dispatch but it seems to be less comfortable than using mutable
structs.Consider the following functions:
And now you could do
If you want to dispatch only on field names you could do: