master
CrossNox 3 years ago
parent 1628337f42
commit 9abc94664d
  1. 11
      src/rustint/core.clj

@ -1725,6 +1725,13 @@
(or arg1 arg2) (or arg1 arg2)
) )
; No puedo usar and a secas:
; Can't take value of a macro: #'clojure.core/and
(defn and-diadico [arg1 arg2]
(and arg1 arg2)
)
(defn interpretar [cod regs-de-act cont-prg pila mapa-regs] (defn interpretar [cod regs-de-act cont-prg pila mapa-regs]
(let [fetched (cod cont-prg), (let [fetched (cod cont-prg),
opcode (if (symbol? fetched) fetched (first fetched)), opcode (if (symbol? fetched) fetched (first fetched)),
@ -1975,6 +1982,10 @@
OR (let [res (aplicar-operador-diadico or-diadico pila)] OR (let [res (aplicar-operador-diadico or-diadico pila)]
(if (nil? res) res (recur cod regs-de-act (inc cont-prg) res mapa-regs))) (if (nil? res) res (recur cod regs-de-act (inc cont-prg) res mapa-regs)))
; AND: Como ADD, pero calcula el and entre los dos valores.
AND (let [res (aplicar-operador-diadico and-diadico pila)]
(if (nil? res) res (recur cod regs-de-act (inc cont-prg) res mapa-regs)))
) )
) )
) )

Loading…
Cancel
Save