*** empty log message ***
authorhanda <handa>
Sat, 20 Mar 2010 09:00:49 +0000 (09:00 +0000)
committerhanda <handa>
Sat, 20 Mar 2010 09:00:49 +0000 (09:00 +0000)
xex.js

diff --git a/xex.js b/xex.js
index 19683a1..705a99b 100644 (file)
--- a/xex.js
+++ b/xex.js
@@ -37,7 +37,7 @@ var Xex = {};
                 overflow: 'auto' };
   
   // Toggle logging on and off.  PARENT if non-null specifies the
                 overflow: 'auto' };
   
   // Toggle logging on and off.  PARENT if non-null specifies the
-  // parent of the log node.  The log node is appended to the parent.
+  // parent of the log node.  The log node is appended to PARENT.
   // If PARENT is null, 'body' node is assumed.
   Xex.LogToggle = function (parent)
   {
   // If PARENT is null, 'body' node is assumed.
   Xex.LogToggle = function (parent)
   {
@@ -57,7 +57,8 @@ var Xex = {};
     return log;
   }
 
     return log;
   }
 
-  // Log ARG
+  // Log ARG (string).  INDENT if specified is a number of columns to
+  // indent.  If INDENT is -1, ARG is appended to the last log.
   Xex.Log = function (arg, indent)
   {
     if (! log)
   Xex.Log = function (arg, indent)
   {
     if (! log)
@@ -76,10 +77,10 @@ var Xex = {};
        else
          {
            lines++;
        else
          {
            lines++;
-           if (lines >= 60)
+           if (lines >= 256)
              {
                node = log.firstElement ();
              {
                node = log.firstElement ();
-               log.start = lines - 58;
+               log.start = lines - 254;
              }
            else
              node = document.createElement ('li');
              }
            else
              node = document.createElement ('li');
@@ -158,10 +159,7 @@ Xex.Function = function (name, with_var, min_args, max_args)
 
 Xex.Subrountine = function (builtin, name, with_var, min_args, max_args)
 {
 
 Xex.Subrountine = function (builtin, name, with_var, min_args, max_args)
 {
-  this.name = name;
-  this.with_var = with_var;
-  this.min_args = min_args;
-  this.max_args = max_args;
+  Xex.Function.apply (this, [name, with_var, min_args, max_args]);
   this.builtin = builtin;
 }
 
   this.builtin = builtin;
 }
 
@@ -179,10 +177,7 @@ Xex.Subrountine.prototype.Call = function (domain, vari, args)
 
 Xex.SpecialForm = function (builtin, name, with_var, min_args, max_args)
 {
 
 Xex.SpecialForm = function (builtin, name, with_var, min_args, max_args)
 {
-  this.name = name;
-  this.with_var = with_var;
-  this.min_args = min_args;
-  this.max_args = max_args;
+  Xex.Function.apply (this, [name, with_var, min_args, max_args]);
   this.builtin = builtin;
 }
 
   this.builtin = builtin;
 }
 
@@ -193,9 +188,7 @@ Xex.SpecialForm.prototype.Call = function (domain, vari, args)
 
 Xex.Lambda = function (name, min_args, max_args, args, body)
 {
 
 Xex.Lambda = function (name, min_args, max_args, args, body)
 {
-  this.name = name;
-  this.min_args = min_args;
-  this.max_args = max_args;
+  Xex.Function.apply (this, [name, false, min_args, max_args]);
   this.args = args;
   this.body = body;
 }
   this.args = args;
   this.body = body;
 }
@@ -246,9 +239,7 @@ Xex.Lambda.prototype.Call = function (domain, vari, args)
 
 Xex.Macro = function (name, min_args, max_args, args, body)
 {
 
 Xex.Macro = function (name, min_args, max_args, args, body)
 {
-  this.name = name;
-  this.min_args = min_args;
-  this.max_args = max_args;
+  Xex.Function.apply (this, [name, false, min_args, max_args]);
   this.args = args;
   this.body = body;
 }
   this.args = args;
   this.body = body;
 }