UndefVarError for defined function

I think I may have some syntax error here but I can’t figure out what it is. I am trying to write and use a function called probit. In the long term I would like to save this function into a file but for now I’m just trying to call it in the same script

using SpecialFunctions: erf
        function probit(x)
                return 0.5*(1+erf(x/sqrt(2)))


I get an error “UndefVarError: probit not defined”

but I have just defined it in the line above. Is there some problem with my syntax?

There is nothing wrong with the code, and it does work for me:

julia> using SpecialFunctions: erf

julia> function probit(x)
           return 0.5*(1+erf(x/sqrt(2)))
probit (generic function with 1 method)

julia> probit(1)

did you properly evaluate/define the function before you ran it?

oh, not I did not. What I am trying to do however is to evaluate this all in one go. So basically I have a single file, Probit.jl, which I am running all at once in atom. Actually I think the issue may have been that I just wasn’t running the script in the right order. Thanks!