How to specify function name specific functions? Is that possible?

I currently have functions like

function AnalyticalExpectation(distribution::Normal, g::Function)  
    if(g==log)
        return ...
    else
        println("Not yet implemented")
    end
end

Is there a way to make this

function AnalyticalExpectation(distribution::Normal, g::IsLog)  
        return ...
end

instead?

You could do f(distribution::Normal, g::typof(log))

2 Likes

Awesome! Thanks! You just gotta love the Julia community … solutions in under 3min! Wow!