Hi all,

This works:
f(x) = g(x) * g(x)
g(x) = x + 1
f(2)    # 9

That is, f(x) isn't fully defined until g is defined.

But if f(x) is in a module it doesn't work:
module myfunc
   export f
   f(x) = g(x) * g(x)
end

using myfunc
g(x) = x + 1
f(2)   # ERROR: UndefVarError: g not defined

That is, myfunc.f(x) cannot access global g(x) if g(x) is defined after 
myfunc (or even before). Is it possible to enable myfunc.f to "see" g?
Any other ways to achieve the same thing?

Cheers,
Jock

Reply via email to