diff options
author | mRnea <[email protected]> | 2024-07-29 23:15:38 +0300 |
---|---|---|
committer | mRnea <[email protected]> | 2024-07-29 23:15:38 +0300 |
commit | 004c2b5628ba2db3297829a76a1e3983c62926ab (patch) | |
tree | dd4abf91fceafe9fc69c07835a9c8da2f6dc5c82 /assembly.lisp | |
parent | 49b58b2d57eb9ae5a5d587bf6144f198797da0a2 (diff) |
some arrangements to fix quirks of symbols in the executable program
note that (eq 'baz:foo bar:foo) is not true
so some stuff that works in the repl fails in executable
Diffstat (limited to 'assembly.lisp')
-rw-r--r-- | assembly.lisp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/assembly.lisp b/assembly.lisp index e2b62f1..81b0ca1 100644 --- a/assembly.lisp +++ b/assembly.lisp @@ -1,6 +1,6 @@ (in-package :cl-forth) -(defparameter *operations* (make-hash-table)) +(defparameter *operations* (make-hash-table :test 'equal)) (eval-always (defun normalize-op-list (asm-list) @@ -27,7 +27,7 @@ (defmacro defop (op-name+args (&key (indent 4)) &body body) (with-gensyms (out-stream) (destructuring-bind (op-name . args) (mklist op-name+args) - `(setf (gethash ',op-name *operations*) + `(setf (gethash ,(string op-name) *operations*) (lambda (,out-stream ,@args) ,(if (or (stringp (car body)) (stringp (caar body))) `(defop-format ,out-stream ,indent @@ -141,7 +141,7 @@ (format str " ;; -- ~s --~%" op)) (defun gen-code (op str) - (let ((op-fn (gethash (car op) *operations*))) + (let ((op-fn (gethash (string (car op)) *operations*))) (if (null op-fn) (error "~s is not a valid op" op) (apply op-fn str (cdr op))))) |