Name:

parse parses an expression contained in a string

Usage:

parse(string) : string -> function | error

Parameters:

Description:

Example 1:

   > parse("exp(x)");
   exp(x)

Example 2:

   > text = "remez(exp(x),5,[-1;1])";
   > print("The string", text, "gives", parse(text));
   The string remez(exp(x),5,[-1;1]) gives 1.00004475029055070643077052482053398765426158966754 + x * (1.00003834652983970735244541124504033817544233075356 + x * (0.49919698262882986492168824494240374771969012861297 + x * (0.166424656075155194415920597322727380932279602909199 + x * (4.37936963873280470271257566207183496659575464236489e-2 + x * 8.7381910388065551140158420278330960479960476713376e-3))))

Example 3:

   > verbosity = 1!;
   > parse("5 + * 3");
   Warning: syntax error, unexpected MULTOKEN. Will try to continue parsing (expecting ";"). May leak memory.
   Warning: the string "5 + * 3" could not be parsed by the miniparser.
   Warning: at least one of the given expressions or a subexpression is not correctly typed
   or its evaluation has failed because of some error on a side-effect.
   error
See also: execute, readfile, print, error, dieonerrormode
Go back to the list of commands