                [false _] (makeclassdefmap glob-state (hash-map) (second clssexpr) (nth clssexpr 2))
                )
   )
-
-
 
 (defn class-dep
   [clsdef]

    (m/domonad util/phase-m
               [funs (funsred split-funs (.-funs glob-state))
                new-glob-state (m-result (update glob-state :funs (fn [_] funs)))
                n-glob-state (do (println new-glob-state) (main-check new-glob-state))
                result (do (println n-glob-state) (reduce check (m-result n-glob-state) (vec tree)))
                ]
               (do
                 result)
               )

    ))

;(analize (vec [
;               [:fndef [:int] [:ident "main"] [:args] [:block [:sexp [:expr [:eapp [:ident "printInt"] [:expr [:elitint 1]]]]] [:sexp [:expr [:evar [:ident "return"]]]]]]
;               [:fndef [:int] [:ident "g"] [:args [:arg [:tident [:ident "string"]] [:ident "a"]]] [:block [:ret [:expr [:eadd [:elitint 4] [:plus] [:elitint 2]]]]]]
;               [:fndef [:int] [:ident "h"] [:args [:arg [:tident [:ident "string"]] [:ident "a"]]] [:block [:ret [:expr [:eadd [:elitint 4] [:plus] [:elitint 2]]]]]]
;               [:fndef [:int] [:ident "f"] [:args [:arg [:int] [:ident "a"]] [:arg [:int] [:ident "b"]]] [:block [:ret [:expr [:eapp [:ident "g"] [:expr [:estring "132"]]]]]]]
;               ]))


(defn check-type
  [glob-state funexpr]
  ;(match/match funexpr [_ [type] [_ name] args block]
  ;             (m/domonad util/phase-m
  ;               [vars (m-result (add-args (vars-map) args))]
  ;               )
  ;             )
  (util/succ funexpr)
  )

(defn analyze-fun
  [glob-state funexpr]
  (match/match funexpr [_ [type] [_ name] args block]
               (if (not (or (= type :void) (terminated block)))
                 (do (println "err") (util/err (str "return not found in function " name "\n" (util/ip-meta funexpr))))
                 (do (println funexpr) (check-type glob-state funexpr))
                 )
               )
  )

(defn check
  [glob-state]
  (println glob-state)
  (fn [expr]
    (m/domonad util/phase-m
               [state glob-state
                res (match/match (first expr)
                                 ;:clssdef (analyze-class state (second expr))
                                 :fndef (analyze-fun state expr))]
               (do (println "ser") (println res) res))))

(defn merge-checks
  [acc cur]
  (m/domonad util/phase-m
             [acc acc
              curr cur]
              (conj acc curr)
             ))

(defn analize
  [tree]
