Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

NEW

Draft MDC Standard

8.2.24 New

N[EW] postcond

[ SP ]
SP L newargument


    newargument::=



lname
newsvn
( L lname )
@ expratom V L newargument




    newsvn::=



$ET[RAP]
$ES[TACK]
$R[EFERENCE]
$T[EST]




New provides a means of performing variable scoping.

The four argument forms of New are given the following names:

   a) lname:Selective New
b) (L lname):Exclusive New
c) Empty argument list:New All
d) newsvnNew svn

The following discussion uses terms defined in the Variable Handling (see 7.1.2.2) and Process-Stack (see 7.1.2.3) models and, like those subclauses, does not imply a required implementation technique. Each argument of the New command creates a CONTEXT-STRUCTURE consisting of a New NAME-TABLE and an exclusive indicator, attaches it to a linked list of CONTEXT-STRUCTUREs associated with the current PROCESS-STACK frame, and modifies currently active NAME-TABLEs as follows:

   a) New All marks the CONTEXT-STRUCTURE as exclusive, copies the currently active NAME-TABLE to the New NAME-TABLE and makes all entries in the currently active local variable NAME-TABLE point to empty DATA-CELLs.
b) Exclusive New marks the CONTEXT-STRUCTURE as exclusive, copies the currently active NAME-TABLE to the New NAME-TABLE and changes all entries in the currently active local variable NAME-TABLE, except for those corresponding to names specified by the command argument, to point to empty DATA-CELLs.
c) Selective New copies the entry corresponding to the name specified by the command argument to the New NAME-TABLE and makes that entry in the currently active NAME-TABLE point to an empty DATA-CELL.
d) New svn copies the entry corresponding to the name specified by the command argument to the New NAME-TABLE and updates that entry as follows:
  1. if the argument specifies $ES[TACK], points to a DATA-CELL with a value of 0 (zero).
  2. if the argument specifies $ET[RAP], points to a DATA-CELL with a value copied from the prior DATA-CELL (as pointed to by the just-copied NAME-TABLE entry).
  3. if the argument specifies $R[EFERENCE], points to a DATA-CELL with a value copied from the priod DATA-CELL (as pointed to by the just-copied NAME-TABLE entry)
  4. if the argument specifies $T[EST], points to a DATA-CELL with a value copied from the prior DATA-CELL (as pointed to by the just-copied NAME-TABLE entry).
Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 15-Nov-2023, 14:46:14.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)