From c6031e3afd3230b197f19e8b9f746c81fdf08d9f Mon Sep 17 00:00:00 2001 From: CrossNox Date: Sun, 27 Nov 2022 18:06:44 -0300 Subject: [PATCH] fix code --- src/rustint/core.clj | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/rustint/core.clj b/src/rustint/core.clj index bf57369..b5aa200 100644 --- a/src/rustint/core.clj +++ b/src/rustint/core.clj @@ -2071,9 +2071,16 @@ ; user=> (ya-declarado-localmente? 'Write [[0 2] [['io ['lib '()] 0] ['Write ['lib '()] 0] ['entero_a_hexa ['fn [(list ['n (symbol ":") 'i64]) 'String]] 2]]]) ; false ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;TODO +(defn in? + "true if coll contains elm" + [coll elm] + (some #(= elm %) coll)) + (defn ya-declarado-localmente? [ident ctx] - true + (let [inicio_scope_local (last (get ctx 0)), + scope_local (subvec (get ctx 1) inicio_scope_local), + identificadores_scope_local (map first scope_local) + ] (in? identificadores_scope_local ident)) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;