Diff for /freem/doc/freem.texi between versions 1.36 and 1.38

version 1.36, 2025/05/02 14:35:40 version 1.38, 2025/05/02 20:01:12
Line 248  FreeM uses abbreviations for common lang Line 248  FreeM uses abbreviations for common lang
 @table @asis  @table @asis
 @item @emph{$PREFIX}  @item @emph{$PREFIX}
 Refers to the base filesystem location within which FreeM is installed. For most distribution methods of FreeM, @emph{$PREFIX} represents either @code{/} or @code{/usr/local}.  Refers to the base filesystem location within which FreeM is installed. For most distribution methods of FreeM, @emph{$PREFIX} represents either @code{/} or @code{/usr/local}.
   @item @emph{dlabel}
   Refers to a label in an M routine, beginning in the first column of the line. Can be a @emph{name} or an @emph{intlit}.
   @item @emph{entryref}
   Refers to an M routine entry point, denoted in the format @code{@emph{dlabel} [+@emph{intexpr}][^@emph{routine}]}.
 @item @emph{expr}  @item @emph{expr}
 Refers to any expression. Often presented in the format @emph{expr V <type>}, where @emph{V} means @emph{giving}; e.g., @emph{expr V lvn} means @emph{expression giving local variable name}.  Refers to any expression. Often presented in the format @emph{expr V <type>}, where @emph{V} means @emph{giving}; e.g., @emph{expr V lvn} means @emph{expression giving local variable name}.
 @item @emph{glvn}  @item @emph{glvn}
Line 256  Refers to the name of an M global, local Line 260  Refers to the name of an M global, local
 Refers to the name of an M global variable.  Refers to the name of an M global variable.
 @item @emph{intexpr}  @item @emph{intexpr}
 Refers to an integer expression.  Refers to an integer expression.
   @item @emph{intlit}
   Refers to an integer literal.
 @item @emph{ISV}, @emph{isv}  @item @emph{ISV}, @emph{isv}
 Refers to an M intrinsic special variable; @code{$JOB} and @code{$IO} are examples of ISVs.  Refers to an M intrinsic special variable; @code{$JOB} and @code{$IO} are examples of ISVs.
 @item @emph{L}  @item @emph{L}
 Indicates a @emph{list} of the following item, e.g., @emph{L gvn} means @emph{list of global variable names}.  Indicates a @emph{list} of the following item, e.g., @emph{L gvn} means @emph{list of global variable names}.
 @item @emph{lvn}  @item @emph{lvn}
 Refers to the name of an M local variable.  Refers to the name of an M local variable.
   @item @emph{strlit}
   Refers to an M string literal.
 @item @emph{ssvn}  @item @emph{ssvn}
 Refers to the name of an M structured system variable.  Refers to the name of an M structured system variable.
 @item @emph{tvexpr}  @item @emph{tvexpr}
Line 4743  The effect of this is that the operation Line 4751  The effect of this is that the operation
 @cindex variables, local  @cindex variables, local
 @cindex local variables  @cindex local variables
   
   @section Local Variables Overview
   
   FreeM @emph{local variables} have the same data structure as global variables, but are scoped to a single FreeM process, and stored in memory.
   
   Each local comprises three elements:
   
   @itemize @bullet
   @item
   An alphabetic name beginning with a letter or a percent sign (@code{%})
   @item
   Optionally, one or more comma-delimited subscripts, enclosed in parentheses
   @item
   A value of up to 255 characters in length
   @end itemize
   
   @node Creating Local Variables
   @section Creating Local Variables
   @cindex local variables, creating
   
   To create a local variable, use the @code{SET} command:
   
   @example
   SET MYLOCAL("foo","bar")="this is the data value"
   @end example
   
   @node Removing Local Variables
   @section Removing Local Variables
   @cindex local variables, removing
   
   To remove an entire local variable, you can use the @code{KILL} command with the unsubscripted name of the variable:
   
   @example
   KILL MYLOCAL
   @end example
   
   If you only want to remove part of a local variable, i.e., beginning at a certain subscript level, use the @code{KILL} command with a subscripted name:
   
   @example
   KILL MYLOCAL("foo")
   @end example
   
   This will remove only the @code{"foo"} subscript and all of its children.
   
   If you only want to remove the data value at a specific subscript level, leaving the subscript itself intact, use @code{KVALUE}:
   
   @example
   KVALUE MYLOCAL("foo")
   @end example
   
 @node Scoping  @node Scoping
 @chapter Scoping  @chapter Scoping
 @cindex scoping  @cindex scoping
   
   By default, FreeM local variables and their values are scoped to the entire process, meaning that any function or subroutine can access and modify their values. This can lead to pernicious bugs.
   
   M provides the @code{NEW} command to work around these issues. When @code{NEW} is called with a local variable as its argument, FreeM will scope the variable to the process stack frame in which the @code{NEW} command occured. When exiting the stack frame (i.e. with the @code{QUIT} command), FreeM will restore the variable to its value prior to being @code{NEW}ed.
   
 @node Decision Constructs  @node Decision Constructs
 @chapter Decision Constructs  @chapter Decision Constructs
 @cindex decision constructs  @cindex decision constructs

Removed from v.1.36  
changed lines
  Added in v.1.38


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>