(Apparently I had problems finding a proper title for this post!)
Dear All,
I was playing around with the simple idea of switching evaluation of some functions globally off or on. Please have a look at the following minimal example:
ClearAll[func, validQ, foo]
(* defining some function - with "evaluation switch": *)
func[arg_?validQ] := arg
(* switching evaluation OFF: *)
validQ[_] = False;
(* making a simple setting: *)
foo = func[a];
(* result - as expected: *)
{foo, func[a]}
(* Out: {func[a],func[a]} *)
(* switching evaluation ON: *)
validQ[_] = True;
(* `foo` does not evaluate! *)
{foo, func[a]}
(* Out: {func[a], a} *)
So my question is: Why on Earth I cannot make foo
evaluate. Obviously I am missing here some very basic point ...
Regards and many thanks -- Henrik