From 9abc94664d72f0d57cf4fb36b0f7e2d1012972ff Mon Sep 17 00:00:00 2001 From: CrossNox Date: Tue, 29 Nov 2022 05:37:16 -0300 Subject: [PATCH] agrego and --- src/rustint/core.clj | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/rustint/core.clj b/src/rustint/core.clj index 184e0d7..c8f59d9 100644 --- a/src/rustint/core.clj +++ b/src/rustint/core.clj @@ -1725,6 +1725,13 @@ (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] (let [fetched (cod cont-prg), opcode (if (symbol? fetched) fetched (first fetched)), @@ -1975,6 +1982,10 @@ OR (let [res (aplicar-operador-diadico or-diadico pila)] (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))) + ) ) )