From 004c2b5628ba2db3297829a76a1e3983c62926ab Mon Sep 17 00:00:00 2001 From: mRnea Date: Mon, 29 Jul 2024 23:15:38 +0300 Subject: 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 --- assembly.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'assembly.lisp') 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))))) -- cgit v1.2.3