Mercurial > hg > octave-lyh
changeset 9038:fca0dc2fb042
Cleanup documentation files stmt.texi and func.texi
Spellcheck
Style check (especially two spaces after period)
Info menu now uses @code macro when describing code statements such as while, for, if, etc.
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Sun, 22 Mar 2009 11:15:35 -0700 |
parents | 4cb9f994dcec |
children | 51dc9691f23f |
files | doc/interpreter/dynamic.txi doc/interpreter/errors.txi doc/interpreter/func.txi doc/interpreter/octave.texi doc/interpreter/stmt.txi doc/interpreter/tips.txi scripts/miscellaneous/edit.m scripts/miscellaneous/symvar.m scripts/path/pathdef.m scripts/path/savepath.m src/DLD-FUNCTIONS/dispatch.cc src/ov-fcn-inline.cc src/parse.y |
diffstat | 13 files changed, 97 insertions(+), 97 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/dynamic.txi +++ b/doc/interpreter/dynamic.txi @@ -1085,7 +1085,7 @@ allocate any memory that is needed by the foreign code, with either the fortran_vec method or the @code{OCTAVE_LOCAL_BUFFER} macro. -The Octave unwind_protect mechanism (@ref{The unwind_protect Statement}) +The Octave unwind_protect mechanism (@ref{The @code{unwind_protect} Statement}) can also be used in oct-files. In conjunction with the exception handling of Octave, it is important to enforce that certain code is run to allow variables, etc to be restored even if an exception occurs. An
--- a/doc/interpreter/errors.txi +++ b/doc/interpreter/errors.txi @@ -44,7 +44,7 @@ Since an error can occur during the evaluation of a program, it is very convenient to be able to detect that an error occurred, so that the error can be fixed. This is possible with the @code{try} statement -described in @ref{The try Statement}. +described in @ref{The @code{try} Statement}. @menu * Raising Errors:: @@ -126,7 +126,7 @@ @subsection Catching Errors When an error occurs, it can be detected and handled using the -@code{try} statement as described in @ref{The try Statement}. +@code{try} statement as described in @ref{The @code{try} Statement}. As an example, the following piece of code counts the number of errors that occurs during a @code{for} loop.
--- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -362,7 +362,7 @@ @noindent and then use the value of @code{nargin} to determine which of the input -arguments should be considered. The problem with this approach is +arguments should be considered. The problem with this approach is that it can only handle a limited number of input arguments. If the special parameter name @code{varargin} appears at the end of a @@ -378,9 +378,9 @@ @noindent In the function body the input arguments can be accessed through the -variable @code{varargin}. This variable is a cell array containing -all the input arguments. @xref{Cell Arrays}, for details on working -with cell arrays. The @code{smallest} function can now be defined +variable @code{varargin}. This variable is a cell array containing +all the input arguments. @xref{Cell Arrays}, for details on working +with cell arrays. The @code{smallest} function can now be defined like this @example @@ -504,7 +504,7 @@ @deffn {Keyword} return When Octave encounters the keyword @code{return} inside a function or -script, it returns control to the caller immediately. At the top level, +script, it returns control to the caller immediately. At the top level, the return statement is ignored. A @code{return} statement is assumed at the end of every function definition. @end deffn @@ -514,7 +514,7 @@ @cindex default arguments Since Octave supports variable number of input arguments, it is very useful -to assign default values to some input arguments. When an input argument +to assign default values to some input arguments. When an input argument is declared in the argument list it is possible to assign a default value to the argument like this @@ -636,14 +636,14 @@ @subsection Manipulating the load path When a function is called, Octave searches a list of directories for -a file that contains the function declaration. This list of directories -is known as the load path. By default the load path contains +a file that contains the function declaration. This list of directories +is known as the load path. By default the load path contains a list of directories distributed with Octave plus the current -working directory. To see your current load path call the @code{path} +working directory. To see your current load path call the @code{path} function without any input or output arguments. It is possible to add or remove directories to or from the load path -using @code{addpath} and @code{rmpath}. As an example, the following +using @code{addpath} and @code{rmpath}. As an example, the following code adds @samp{~/Octave} to the load path. @example @@ -712,14 +712,14 @@ In many cases one function needs to access one or more helper functions. If the helper function is limited to the scope of a single -function, then subfunctions as discussed above might be used. However, +function, then subfunctions as discussed above might be used. However, if a single helper function is used by more than one function, then this is no longer possible. In this case the helper functions might be placed in a subdirectory, called "private", of the directory in which the functions needing access to this helper function are found. As a simple example, consider a function @code{func1}, that calls a helper -function @code{func2} to do much of the work. For example +function @code{func2} to do much of the work. For example @example @group @@ -739,9 +739,9 @@ @subsection Overloading and Autoloading The @code{dispatch} function can be used to alias one function name to -another. It can be used to alias all calls to a particular function name +another. It can be used to alias all calls to a particular function name to another function, or the alias can be limited to only a particular -variable type. Consider the example +variable type. Consider the example @example @group @@ -759,7 +759,7 @@ @noindent which aliases the user-defined function @code{spsin} to @code{sin}, but only for real sparse -matrices. Note that the builtin @code{sin} already correctly treats +matrices. Note that the builtin @code{sin} already correctly treats sparse matrices and so this example is only illustrative. @DOCSTRING(dispatch) @@ -767,16 +767,16 @@ @DOCSTRING(builtin) A single dynamically linked file might define several -functions. However, as Octave searches for functions based on the +functions. However, as Octave searches for functions based on the functions filename, Octave needs a manner in which to find each of the -functions in the dynamically linked file. On operating systems that +functions in the dynamically linked file. On operating systems that support symbolic links, it is possible to create a symbolic link to the original file for each of the functions which it contains. However, there is at least one well known operating system that doesn't -support symbolic links. Making copies of the original file for each of +support symbolic links. Making copies of the original file for each of the functions is undesirable as it increases the -amount of disk space used by Octave. Instead Octave supplies the +amount of disk space used by Octave. Instead Octave supplies the @code{autoload} function, that permits the user to define in which file a certain function will be found. @@ -786,7 +786,7 @@ @subsection Function Locking It is sometime desirable to lock a function into memory with the -@code{mlock} function. This is typically used for dynamically linked +@code{mlock} function. This is typically used for dynamically linked functions in Oct-files or mex-files that contain some initialization, and it is desirable that calling @code{clear} does not remove this initialization. @@ -864,9 +864,9 @@ @node Function Precedence @subsection Function Precedence -Given the numereous different ways that Octave can define a function, it +Given the numerous different ways that Octave can define a function, it is possible and even likely that multiple versions of a function, might be -defined within a particular scope. The precedence of which function will be +defined within a particular scope. The precedence of which function will be used within a particular scope is given by @enumerate 1 @@ -895,7 +895,7 @@ A function that is marked as autoloaded with @xref{doc-autoload}. @item A Function on the Path -A function that can be found on the users load-path. There can also be +A function that can be found on the users load-path. There can also be Oct-file, mex-file or m-file versions of this function and the precedence between these versions are in that order. @@ -939,7 +939,7 @@ # Define function one: function one () - ... + @dots{} @end group @end example @@ -1015,9 +1015,9 @@ @cindex anonymous functions It can be very convenient store a function in a variable so that it -can be passed to a different function. For example, a function that -performs numerical minimisation needs access to the function that -should be minimised. +can be passed to a different function. For example, a function that +performs numerical minimization needs access to the function that +should be minimized. @menu * Function Handles:: @@ -1126,7 +1126,7 @@ @subsection Inline Functions An inline function is created from a string containing the function -body using the @code{inline} function. The following code defines the +body using the @code{inline} function. The following code defines the function @math{f(x) = x^2 + 2}. @example @@ -1151,7 +1151,7 @@ @section Commands Commands are a special class of functions that only accept string -input arguments. A command can be called as an ordinary function, but +input arguments. A command can be called as an ordinary function, but it can also be called without the parentheses like the following example shows @@ -1191,9 +1191,9 @@ where @code{name} is the function to be marked as a command. One difficulty of commands occurs when one of the string input arguments -are stored in a variable. Since Octave can't tell the difference between +are stored in a variable. Since Octave can't tell the difference between a variable name, and an ordinary string, it is not possible to pass a -variable as input to a command. In such a situation a command must be +variable as input to a command. In such a situation a command must be called as a function. @DOCSTRING(mark_as_command)
--- a/doc/interpreter/octave.texi +++ b/doc/interpreter/octave.texi @@ -360,15 +360,15 @@ Statements -* The if Statement:: -* The switch Statement:: -* The while Statement:: -* The do-until Statement:: -* The for Statement:: -* The break Statement:: -* The continue Statement:: -* The unwind_protect Statement:: -* The try Statement:: +* The @code{if} Statement:: +* The @code{switch} Statement:: +* The @code{while} Statement:: +* The @code{do-until} Statement:: +* The @code{for} Statement:: +* The @code{break} Statement:: +* The @code{continue} Statement:: +* The @code{unwind_protect} Statement:: +* The @code{try} Statement:: * Continuation Lines:: The @code{switch} Statement
--- a/doc/interpreter/stmt.txi +++ b/doc/interpreter/stmt.txi @@ -47,19 +47,19 @@ @dfn{body} of a control statement. @menu -* The if Statement:: -* The switch Statement:: -* The while Statement:: -* The do-until Statement:: -* The for Statement:: -* The break Statement:: -* The continue Statement:: -* The unwind_protect Statement:: -* The try Statement:: +* The @code{if} Statement:: +* The @code{switch} Statement:: +* The @code{while} Statement:: +* The @code{do-until} Statement:: +* The @code{for} Statement:: +* The @code{break} Statement:: +* The @code{continue} Statement:: +* The @code{unwind_protect} Statement:: +* The @code{try} Statement:: * Continuation Lines:: @end menu -@node The if Statement +@node The @code{if} Statement @section The @code{if} Statement @cindex @code{if} statement @cindex @code{else} statement @@ -208,7 +208,7 @@ using the indentation to show how Octave groups the statements. @xref{Functions and Scripts}. -@node The switch Statement +@node The @code{switch} Statement @section The @code{switch} Statement @cindex @code{switch} statement @cindex @code{case} statement @@ -216,7 +216,7 @@ @cindex @code{endswitch} statement It is very common to take different actions depending on the value of -one variable. This is possible using the @code{if} statement in the +one variable. This is possible using the @code{if} statement in the following way @example @@ -231,8 +231,8 @@ @noindent This kind of code can however be very cumbersome to both write and -maintain. To overcome this problem Octave supports the @code{switch} -statement. Using this statement, the above example becomes +maintain. To overcome this problem Octave supports the @code{switch} +statement. Using this statement, the above example becomes @example switch (X) @@ -247,7 +247,7 @@ @noindent This code makes the repetitive structure of the problem more explicit, -making the code easier to read, and hence maintain. Also, if the +making the code easier to read, and hence maintain. Also, if the variable @code{X} should change its name, only one line would need changing compared to one line per case when @code{if} statements are used. @@ -270,16 +270,16 @@ @end example @noindent -where @var{label} can be any expression. However, duplicate +where @var{label} can be any expression. However, duplicate @var{label} values are not detected, and only the @var{command_list} -corresponding to the first match will be executed. For the +corresponding to the first match will be executed. For the @code{switch} statement to be meaningful at least one @code{case @var{label} @var{command_list}} clause must be present, while the @code{otherwise @var{command_list}} clause is optional. If @var{label} is a cell array the corresponding @var{command_list} is executed if @emph{any} of the elements of the cell array match -@var{expression}. As an example, the following program will print +@var{expression}. As an example, the following program will print @samp{Variable is either 6 or 7}. @example @@ -299,7 +299,7 @@ @c Strings can be matched One advantage of using the @code{switch} statement compared to using -@code{if} statements is that the @var{label}s can be strings. If an +@code{if} statements is that the @var{label}s can be strings. If an @code{if} statement is used it is @emph{not} possible to write @example @@ -328,7 +328,7 @@ @subsection Notes for the C programmer The @code{switch} statement is also available in the widely used C -programming language. There are, however, some differences +programming language. There are, however, some differences between the statement in Octave and C @itemize @bullet @@ -363,7 +363,7 @@ @end example @noindent -particularly for C programmers. If @code{doit()} should be executed if +particularly for C programmers. If @code{doit()} should be executed if @var{foo} is either @code{1} or @code{2}, the above code should be written with a cell array like this @@ -377,7 +377,7 @@ @end example @end itemize -@node The while Statement +@node The @code{while} Statement @section The @code{while} Statement @cindex @code{while} statement @cindex @code{endwhile} statement @@ -446,7 +446,7 @@ body; but using one makes the program clearer unless the body is very simple. -@node The do-until Statement +@node The @code{do-until} Statement @section The @code{do-until} Statement @cindex @code{do-until} statement @@ -493,7 +493,7 @@ body; but using one makes the program clearer unless the body is very simple. -@node The for Statement +@node The @code{for} Statement @section The @code{for} Statement @cindex @code{for} statement @cindex @code{endfor} statement @@ -548,7 +548,7 @@ more elements to assign. Within Octave is it also possible to iterate over matrices or cell arrays -using the @code{for} statement. For example consider +using the @code{for} statement. For example consider @example @group @@ -565,10 +565,10 @@ @noindent In this case the variable @code{i} takes on the value of the columns of -the matrix or cell matrix. So the first loop iterates twice, producing +the matrix or cell matrix. So the first loop iterates twice, producing two column vectors @code{[1;2]}, followed by @code{[3;4]}, and likewise -for the loop over the cell array. This can be extended to loops over -multidimensional arrays. For example +for the loop over the cell array. This can be extended to loops over +multidimensional arrays. For example @example @group @@ -616,7 +616,7 @@ In this form of the @code{for} statement, the value of @var{expression} must be a structure. If it is, @var{key} and @var{val} are set to the name of the element and the corresponding value in turn, until there are -no more elements. For example, +no more elements. For example, @example @group @@ -650,7 +650,7 @@ structure elements when the names of the elements do not need to be known. -@node The break Statement +@node The @code{break} Statement @section The @code{break} Statement @cindex @code{break} statement @@ -705,7 +705,7 @@ @end group @end example -@node The continue Statement +@node The @code{continue} Statement @section The @code{continue} Statement @cindex @code{continue} statement @@ -754,7 +754,7 @@ @end group @end example -@node The unwind_protect Statement +@node The @code{unwind_protect} Statement @section The @code{unwind_protect} Statement @cindex @code{unwind_protect} statement @cindex @code{unwind_protect_cleanup} @@ -782,7 +782,7 @@ This is useful to protect temporary changes to global variables from possible errors. For example, the following code will always restore -the original value of the global variable @code{frobnositcate} +the original value of the global variable @code{frobnosticate} even if an error occurs in the first part of the @code{unwind_protect} block. @@ -805,7 +805,7 @@ point of the error and the statement to restore the value would not be executed. -@node The try Statement +@node The @code{try} Statement @section The @code{try} Statement @cindex @code{try} statement @cindex @code{catch}
--- a/doc/interpreter/tips.txi +++ b/doc/interpreter/tips.txi @@ -126,7 +126,7 @@ If you are using @code{eval} as an exception handling mechanism and not because you need to execute some arbitrary text, use the @code{try} -statement instead. @xref{The try Statement}. +statement instead. @xref{The @code{try} Statement}. @item If you are calling lots of functions but none of them will need to
--- a/scripts/miscellaneous/edit.m +++ b/scripts/miscellaneous/edit.m @@ -32,7 +32,7 @@ ## is a system function, then it will first be copied to the directory ## @code{HOME} (see further down) and then edited. ## If no file is found, then the m-file -## variant, ending with ".m", will be considered. If still no file +## variant, ending with ".m", will be considered. If still no file ## is found, then variants with a leading "@@" and then with both a ## leading "@@" and trailing ".m" will be considered. ## @@ -49,7 +49,7 @@ ## function will be inserted into the .cc file as a comment. ## ## @item -## If @var{name.ext} is on your path then it will be editted, otherwise +## If @var{name.ext} is on your path then it will be edited, otherwise ## the editor will be started with @file{HOME/name.ext} as the ## filename. If @file{name.ext} is not modifiable, it will be copied to ## @code{HOME} before editing. @@ -64,7 +64,7 @@ ## If an output argument is requested and the first argument is @code{get} ## then @code{edit} will return the value of the control field @var{field}. ## If the control field does not exist, edit will return a structure -## containing all fields and values. Thus, @code{edit get all} returns +## containing all fields and values. Thus, @code{edit get all} returns ## a complete control structure. ## The following control fields are used: ## @@ -85,15 +85,15 @@ ## ## See also field 'mode', which controls how the editor is run by Octave. ## -## On cygwin, you will need to convert the cygwin path to a windows +## On Cygwin, you will need to convert the Cygwin path to a Windows ## path if you are using a native Windows editor. For example ## @example ## '"C:/Program Files/Good Editor/Editor.exe" "$(cygpath -wa %s)"' ## @end example ## ## @item home -## This is the location of user local m-files. Be be sure it is in your -## path. The default is @file{~/octave}. +## This is the location of user local m-files. Be be sure it is in your +## path. The default is @file{~/octave}. ## ## @item author ## This is the name to put after the "## Author:" field of new functions. @@ -123,12 +123,12 @@ ## @item mode ## This value determines whether the editor should be started in async mode ## (editor is started in the background and Octave continues) or sync mode -## (Octave waits until the editor exits). Set it to "async" to start the editor -## in async mode. The default is "sync" (see also "system"). +## (Octave waits until the editor exits). Set it to "async" to start the editor +## in async mode. The default is "sync" (see also "system"). ## ## @item editinplace ## Determines whether files should be edited in place, without regard to -## whether they are modifiable or not. The default is @code{false}. +## whether they are modifiable or not. The default is @code{false}. ## @end table ## @end deftypefn
--- a/scripts/miscellaneous/symvar.m +++ b/scripts/miscellaneous/symvar.m @@ -20,8 +20,8 @@ ## @deftypefn {Function File} {} symvar (@var{s}) ## Identifies the argument names in the function defined by a string. ## Common constant names such as @code{pi}, @code{NaN}, @code{Inf}, -## @code{eps}, @code{i} or @code{j} are ignored. The arguments that are -## found are returned in a cell array of strings. If no variables are +## @code{eps}, @code{i} or @code{j} are ignored. The arguments that are +## found are returned in a cell array of strings. If no variables are ## found then the returned cell array is empty. ## @end deftypefn
--- a/scripts/path/pathdef.m +++ b/scripts/path/pathdef.m @@ -24,7 +24,7 @@ ## ## @enumerate ## @item @file{~/.octaverc} -## @item @file{<octave-home>/.../<version>/m/startup/octaverc} +## @item @file{<octave-home>/@dots{}/<version>/m/startup/octaverc} ## @item Octave's path prior to changes by any octaverc. ## @end enumerate ## @seealso{path, addpath, rmpath, genpath, savepath, pathsep}
--- a/scripts/path/savepath.m +++ b/scripts/path/savepath.m @@ -18,7 +18,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} savepath (@var{file}) -## Save the the portion of the current function search path, that is +## Save the portion of the current function search path, that is ## not set during Octave's initialization process, to @var{file}. ## If @var{file} is omitted, @file{~/.octaverc} is used. If successful, ## @code{savepath} returns 0.
--- a/src/DLD-FUNCTIONS/dispatch.cc +++ b/src/DLD-FUNCTIONS/dispatch.cc @@ -81,7 +81,7 @@ \n\ Replace the function @var{f} with a dispatch so that function @var{r}\n\ is called when @var{f} is called with the first argument of the named\n\ -@var{type}. If the type is @var{any} then call @var{r} if no other type\n\ +@var{type}. If the type is @var{any} then call @var{r} if no other type\n\ matches. The original function @var{f} is accessible using\n\ @code{builtin (@var{f}, @dots{})}.\n\ \n\
--- a/src/ov-fcn-inline.cc +++ b/src/ov-fcn-inline.cc @@ -602,11 +602,11 @@ @deftypefnx {Built-in Function} {} inline (@var{str}, @var{n})\n\ Create an inline function from the character string @var{str}.\n\ If called with a single argument, the arguments of the generated\n\ -function are extracted from the function itself. The generated\n\ -function arguments will then be in alphabetical order. It should\n\ +function are extracted from the function itself. The generated\n\ +function arguments will then be in alphabetical order. It should\n\ be noted that i, and j are ignored as arguments due to the\n\ ambiguity between their use as a variable or their use as an inbuilt\n\ -constant. All arguments followed by a parenthesis are considered\n\ +constant. All arguments followed by a parenthesis are considered\n\ to be functions.\n\ \n\ If the second and subsequent arguments are character strings,\n\
--- a/src/parse.y +++ b/src/parse.y @@ -3456,7 +3456,7 @@ \n\ The second argument, @var{file}, should be an absolute file name or\n\ a file name in the same directory as the function or script from which\n\ -the autoload command was run. @var{file} should not depend on the\n\ +the autoload command was run. @var{file} should not depend on the\n\ Octave load path.\n\ \n\ Normally, calls to @code{autoload} appear in PKG_ADD script files that\n\ @@ -3468,7 +3468,7 @@ autoload (\"foo\", \"bar.oct\");\n\ @end example\n\ \n\ -will load the function @code{foo} from the file @code{bar.oct}. The above\n\ +will load the function @code{foo} from the file @code{bar.oct}. The above\n\ when @code{bar.oct} is not in the same directory or uses like\n\ \n\ @example\n\