Hi, I'm baffled by the following...if I define a function in a notebook as follows:
func = Function[x^2][x];
I can call it in the notebook:
Table[func, {x, 1, 6}]
{1, 4, 9, 16, 25, 36}
I can also call it in a function defined in the notebook:
runNb[func_] :=
Module[{},
Table[func, {x, 1, 6}]
]
runNb[func]
{1, 4, 9, 16, 25, 36}
but, when I try to run this as a package, the function doesn't evaluate:
BeginPackage["run`"]
run::usage = "run[func]"
Begin["`Private`"]
run[func_] :=
Module[{},
Table[func, {x, 1, 6}]
]
End[]
EndPackage[]
and, calling from the notebook:
<< run.m
run[func]
{x^2, x^2, x^2, x^2, x^2, x^2}
Makes no sense to me! Can anyone please explain?
Thanks