Hello! I've been trying out Julia 0.5-rc1, and noticed one aspect in which 
it behaves differently from 0.4. If I do

function f(x)
    if x > 0
        g(x) = x
    else
        g(x) = -x
    end

    return g(x)
end

​
I get the following warning

WARNING: Method definition in module Main at REPL[1]:3 overwritten at REPL[1]:5.

​
and in fact, g(x) ends up being always -x, that is, a single function g is 
defined in compile time following the last definition inside f. Is that 
behavior expected? I remember doing the same in Julia 0.4 and getting 
different g's depending on the value of x. What's the best way of dealing 
with this?

Thanks!
Andre

Reply via email to