about summary refs log blame commit diff stats
path: root/eval.lsp
blob: 60a19c0122fc7aa150b5fa6a4f2e79b1737028ba (plain) (tree)






















                                                     
(defclass <value> () () (:abstractp t))
(defclass <v-int> (<value>) ((int :accessor int)))
(defclass <v-str> (<value>) ((str :accessor str)))
(defclass <v-bool> (<value>) ((bool :accessor bool)))

(defclass <environment> () ((env :accessor env)))

(defun lookup-index (tprog num-line)
  (block result-lookup-index
    (for ((i 0 (+ i 1)))
      ((>= i (length tprog)))
      (let ((num-i (num (elt tprog i))))
        (if (= num-i num-line)
          (return-from result-lookup-index i)
          (if (> num-i num-line)
            (return-from result-lookup-index -1)))))
    -1))

(defun assemble (prog)
  (let ((tprog (apply #'vector prog)))
    (for ((i 0 (+ i 1)))
      ((>= i (length tprog)))
      ())))