The definition of the function to register.
The body of the function to register.
True if the function successfuly registers, false otherwise.
dstring func = "x + 1"d; assert(registerFunction("a(x) = num(num)"d,func)); func = "x^^2 + 2^^2 j- 3"d; assert(!registerFunction("a(x) = num(num)"d,func)); func = "x.3"; assert(!registerFunction("a(x) = num(num)"d,func)); func = "()"; assert(!registerFunction("a(x) = num(num)"d,func)); func = "x ^ 3"; assert(!registerFunction("a(x) = num(num)"d,func)); func = "x +"; assert(!registerFunction("a(x) = num(num)"d,func)); assert(!registerFunction("a(x) = num(num)"d,"x ++ 1"d)); assert(registerFunction("b(x) = num(num)"d, "x"d)); registerFunction("a(x) = num(num)"d,func); //Fails on MacOS without this. assert(!registerFunction("a(x) = num(num)"d, "x"d));
Registers a function with the given name and function body. A function cannot register if its body has invalid syntax or if its definition has already been used.