# HG changeset patch # User jwe # Date 1179779863 0 # Node ID 6a7fc4105bcc736feaaf12ae470bed964f461b63 # Parent ffee6a1a10f319cab2316dcf2ff3c9864ee0a897 [project @ 2007-05-21 20:37:43 by jwe] diff -r ffee6a1a10f3 -r 6a7fc4105bcc doc/ChangeLog --- a/doc/ChangeLog Mon May 21 19:58:43 2007 +0000 +++ b/doc/ChangeLog Mon May 21 20:37:43 2007 +0000 @@ -5,7 +5,9 @@ * interpreter/eval.txi: Partition the chapter into sections. Describe evalin and assignin functions using text from Paul - Kienzle. + Kienzle. Change "See See" to "See". Use @ref instead of @xref to + avoid "See" to be written with a capital letter in the middle of a + sentence. * interpreter/func.txi: New section describing load path. Improve 'inline' and 'command' sections. diff -r ffee6a1a10f3 -r 6a7fc4105bcc doc/interpreter/basics.txi --- a/doc/interpreter/basics.txi Mon May 21 19:58:43 2007 +0000 +++ b/doc/interpreter/basics.txi Mon May 21 20:37:43 2007 +0000 @@ -148,8 +148,8 @@ Specify the path to search for function files. The value of @var{path} specified on the command line will override any value of @code{OCTAVE_PATH} found in the environment, but not any commands in the -system or user startup files that set the internal variable @code{LOADPATH} -through one of the path functions. +system or user startup files that set the internal load path through one +of the path functions. @item --persist Go to interactive mode after @code{--eval} or reading from a file diff -r ffee6a1a10f3 -r 6a7fc4105bcc src/ChangeLog --- a/src/ChangeLog Mon May 21 19:58:43 2007 +0000 +++ b/src/ChangeLog Mon May 21 20:37:43 2007 +0000 @@ -1,3 +1,7 @@ +2007-05-21 Søren Hauberg + + * parse.y (Feval): Add example. + 2007-05-21 David Bateman * error.cc (rethrow_error): Use NULL name so that "error:" is not diff -r ffee6a1a10f3 -r 6a7fc4105bcc src/parse.y --- a/src/parse.y Mon May 21 19:58:43 2007 +0000 +++ b/src/parse.y Mon May 21 20:37:43 2007 +0000 @@ -3963,9 +3963,26 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} eval (@var{try}, @var{catch})\n\ Parse the string @var{try} and evaluate it as if it were an Octave\n\ -program. If that fails, evaluate the string @var{catch}.\n\ +program. If that fails, evaluate the optional string @var{catch}.\n\ The string @var{try} is evaluated in the current context,\n\ so any results remain available after @code{eval} returns.\n\ +\n\ +The following example makes the variable @var{a} with the approximate\n\ +value 3.1416 available.\n\ +\n\ +@example\n\ +eval(\"a = acos(-1);\");\n\ +@end example\n\ +\n\ +If an error occurs during the evaluation of @var{try} the @var{catch}\n\ +string is evaluated, as the following example shows.\n\ +\n\ +@example\n\ +eval ('error (\"This is a bad example\");',\n\ + 'printf (\"This error occured:\\n%s\", lasterr ());');\n\ + @print{} This error occured:\n\ + error: This is a bad example\n\ +@end example\n\ @end deftypefn") { octave_value_list retval;