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)) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;