git » jacl.git » commit 30dd260

Exports JACL specials and \.; %SET-VAL => %SETQ

author Alan Dipert
2020-01-06 07:14:00 UTC
committer Alan Dipert
2020-01-06 07:14:00 UTC
parent 85995b0a47de5f17cfdfd8a0e37841f4ffd61217

Exports JACL specials and \.; %SET-VAL => %SETQ

jacl.js +11 -6

diff --git a/jacl.js b/jacl.js
index 3ed7f38..758ada5 100644
--- a/jacl.js
+++ b/jacl.js
@@ -239,11 +239,11 @@ const PACKAGES = new Map();
 class Package {
   constructor(name) {
     this.name = name;
-    // Map of name strings to LispSymbol objects contained in this package
+    // Map of name JS strings to LispSymbol objects contained in this package
     // Note that names may refer to symbols from different packages if they are
     // imported
     this.symbols = new Map();
-    // Set of names (keys of this.symbols) that are exported
+    // Set of JS String names (keys of this.symbols) that are exported
     this.exports = new Set();
     // The 'use list'; list of packages, the symbols of which to also search
     this.use = [];
@@ -772,12 +772,16 @@ const SPECIAL_FORMS = [
   '%LET',
   '%NEW',
   '%PROG',
-  '%SET-VAR',
+  '%SETQ',
   '%TAGBODY',
-  '%GO'
+  '%GO',
+  '%JS'
 ];
 
-for (const s of SPECIAL_FORMS) JACLPKG.intern(s);
+for (const s of SPECIAL_FORMS) {
+  JACLPKG.intern(s);
+  JACLPKG.exportSymbol(s);
+}
 
 CLPKG.intern('QUOTE').setMacro().fvalue = function(env, form, x) {
   return Cons.listOf(JACLPKG.intern('%QUOTE'), x);
@@ -1176,7 +1180,7 @@ const analyzeSpecials = new Map([
     });
     return merge(node, analyzeBlock(env, node, body));
   }],
-  [JACLPKG.intern('%SET-VAR'), (env, parent, form) => {
+  [JACLPKG.intern('%SETQ'), (env, parent, form) => {
     const [, target, val] = form;
     if (!(target instanceof LispSymbol))
       throw new Error(`Can't assign to non-symbol`);
@@ -1862,6 +1866,7 @@ JACLPKG.intern('.')
       }
     }, topic)
   };
+JACLPKG.exportSymbol('.');
 
 let replInputStream = new BufferedStream(),
     replReader = new Reader(replInputStream);