removeFunction

Removes a registered function given its definition.

The function being removed must be registered and must not be an untouchable function.

@safe @nogc nothrow
bool
removeFunction
(
dstring funcdef
)

Parameters

funcdef dstring

The definition of the function to remove.

Return Value

Type: bool

True if the function is succesfully removed, false otherwise.

Examples

dstring func = "x + 1"d;
assert(!removeFunction("c(x) = num(num)"d)); //Apparently data is saved between tests, so a(x) has to be replaced with c(x).
funcList["δ(x) = num(num)"d] = null;
assert(!removeFunction("δ(x) = num(num)"d));
funcList.remove("δ(x) = num(num)");
registerFunction("a(x) = num(num)"d, func);
assert(removeFunction("a(x) = num(num)"d));

Meta