Corrected readtime constants.

Pascal J. Bourguignon [2013-12-26 23:20]
Corrected readtime constants.
Filename
npvm.lisp
diff --git a/npvm.lisp b/npvm.lisp
index 8e92762..c1bf998 100644
--- a/npvm.lisp
+++ b/npvm.lisp
@@ -45,19 +45,23 @@

 (in-package "COM.INFORMATIMAGO.COMPILER-VS-INTERPRETER.NPVM")

-(defconstant +MAX-VARIABLES+ 26)
-
-(defconstant +pushi+ 0)
-(defconstant +pushn+ 1)
-(defconstant +store+ 2)
-(defconstant +neg+   3)
-(defconstant +add+   4)
-(defconstant +mul+   5)
-(defconstant +sub+   6)
-(defconstant +div+   7)
-(defconstant +print+ 8)
-(defconstant +dump+  9)
-(defconstant +stop+ 10)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  ;; so they're available at read-time while compiling.
+
+  (defconstant +MAX-VARIABLES+ 26)
+
+  (defconstant +pushi+ 0)
+  (defconstant +pushn+ 1)
+  (defconstant +store+ 2)
+  (defconstant +neg+   3)
+  (defconstant +add+   4)
+  (defconstant +mul+   5)
+  (defconstant +sub+   6)
+  (defconstant +div+   7)
+  (defconstant +print+ 8)
+  (defconstant +dump+  9)
+  (defconstant +stop+ 10)
+  );eval-when

 (defvar *codops* #((pushi i)
                    (pushn n)
ViewGit