So it is best to ask for more.
I have 2 use cases, in which use
DifferentialEquations to build my library.
I can see that the first case can be “bad”.
step!(integ) is a single argument function used by DiffEq to step an integrator. Inside my module I import
step! and define
+function step!(integ, Δt::Real) + t = integ.t + while integ.t < t + Δt + step!(integ) + end +end
Now, this is “type piracy”. I cannot understand why it is a bad idea though, since DiffEq does not have a 2 argument form of
Obviously if such a method is ever defined, I will get a warning message, therefore this cannot “silently” lead to any unintented results. So why is it bad? Doing something else, like defining a different function name, like e.g.
step_for_dt goes against Julia’s multiple dispatch mentality.
The second case is the following.
I define a function
dimension that does not exist in DiffEq
and then do
dimension(integ::DEIntegrator) = length(integ.u)
Now, I cannot see why this should/could/would be a bad idea.
Anyone care to enlighten me?