dear julia wizards: What is the equivalent of the NULL function to use as a default assignment when typing a function as an argument? by analogy, consider this first:
julia> work(x::Float64=NaN)= ( println("entering"); (!isnan(x)) && println("your x is $x") ) julia> work(1.0) ## with argument entering your x is 12.2 julia> work() ## ok, my default entering false
So, I want to do the same, but passing a function and not a Float.
julia> work(f::Function)= ( println("entering"); println("applying f to 4.0: ", f(4.0)) ); julia> work(sqrt) ## with argument entering applying f to 4.0: 2.0 julia> work() ## this is what I want to enable. a default --- so, here I want to see `entering\n` and then an error
f::Function, I need to put a default argument, something like
nothing is not right, because
work() no longer even prints entering.
what is the magic NULL, NADA, nothing, etc., that one would typically use here? (I could define my own pointer to a nothing function as an alternative.)