The package I'm working has a function myfunc( c, x::Vector)
, where c
needs to be a function that receives two variables and returns a real, e.g. c(x,y) = x^2 + y^2
. My question is, how do I specify this when declaring my function? Should I just write down in the documentation that c
should have this form, or is there a more "correct" way of doing this?
Typically you would just document it, and let the code throw a runtime error.
I see, so I could just leave like that. No need to restrict the type of c
. Great, thanks :D
Last updated: Nov 22 2024 at 04:41 UTC