src/mMath/nde.js
/**
   * @summary **Expression constructor**
   * @description
   * Expressions are an isolated `MNode` DAG along with an editing cursor
   * and selection(s). The undo/redo list is also part of the expression.
   * All of the Ndes within the expression are assigned Nids (node ids) in
   * a closed space local to the expression. An external expression can be
   * referenced from the expression but is not itself part of the expression
   * unless copies of its nodes are inserted.
   *
   * The entire expression including its history and change list are self
   * contained so its easy to serialize the contents (as long as all 
   * external references are suitably truncated).
   *
   * Ndes contain various forward pointing nids that describe the graph.
   * Going backwards in the graph requireds computing the previous nid,
   * by traversing the entire graph from the front.
   * @constructor
   * @param {object} obj any initialization for the Exp.
   * @returns {Exp} a mmath Expression.
   */
@summary **Expression constructor
@description
Expressions are an isolated `MNode` DAG along with an editing cursor
and selection(s). The undo/redo list is also part of the expression.
All of the Ndes within the expression are assigned Nids (node ids) in
a closed space local to the expression. An external expression can be
referenced from the expression but is not itself part of the expression
unless copies of its nodes are inserted.

The entire expression including its history and change list are self
contained so its easy to serialize the contents (as long as all
external references are suitably truncated).

Ndes contain various forward pointing nids that describe the graph.
Going backwards in the graph requireds computing the previous nid,
by traversing the entire graph from the front.
@constructor
@param {object} obj any initialization for the Exp.
@returns {Exp} a mmath Expression.
@summary ** Expression constructor @description Expressions are an isolated ` MNode ` DAG along with an editing cursor and selection ( s ) . The undo / redo list is also part of the expression . All of the Ndes within the expression are assigned Nids ( node ids ) in a closed space local to the expression . An external expression can be referenced from the expression but is not itself part of the expression unless copies of its nodes are inserted . The entire expression including its history and change list are self contained so its easy to serialize the contents ( as long as all external references are suitably truncated ) . Ndes contain various forward pointing nids that describe the graph . Going backwards in the graph requireds computing the previous nid by traversing the entire graph from the front . @constructor @param { object } obj any initialization for the Exp . @returns { Exp } a mmath Expression .
function Exp(obj) {
    var self = this;
    self.type      = 'exp';
    self.context   = self;
    self.parentNid = -1;
    var nodes = [];
    self.initNode = function initNode(self) {
      var nid = nodes.length;
      nodes.push(self);
      self.nid = nid;
    }
    self.initNode(self);
    self.nodes = nodes;
    self.changes = [];
    self.changeIndex = 0;
    MNode.call(this, 'exp', self, 0);
  }
function Exp ( obj ) { var self = this ; self . type = 'exp' ; self . context = self ; self . parentNid = - 1 ; var nodes = [ ] ; self . initNode = function initNode ( self ) { var nid = nodes . length ; nodes . push ( self ) ; self . nid = nid ; } self . initNode ( self ) ; self . nodes = nodes ; self . changes = [ ] ; self . changeIndex = 0 ; MNode . call ( this , 'exp' , self , 0 ) ; }
@summary **Expression constructor
 @description
 Expressions are an isolated `MNode` DAG along with an editing cursor
 and selection(s).
@summary ** Expression constructor @description Expressions are an isolated ` MNode ` DAG along with an editing cursor and selection ( s ) .
//self.root = new MNode(); // Add the node to the local list and assign a unique nid.