Pass functions to objects

If you use something like:

mutable struct System{P, Tup}
    ps::Vector{P}
    forces::Tup
end

You can allow the user to provide a tuple with many forces, which will allow specialized methods, because the tuple is annotated in every element.

2 Likes