tests run but still can't compile tricky function

This commit is contained in:
Erik 2016-03-02 20:41:56 +01:00
parent e79010a70b
commit 8481921756
2 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Compiler # Compiler
- Bake fails: (fn [f a b] (println (ref (str (f a b))))) - Bake fails: (fn [f a b] (println (ref (str (f a b)))))
- Bake can't handle when a function changes signature
- Automatically implement for structs and arrays: - Automatically implement for structs and arrays:
- str - str
- copy - copy

View File

@ -78,8 +78,25 @@
(defn problematic [prob-f prob-a prob-b] (defn problematic [prob-f prob-a prob-b]
(println (ref (str (prob-f prob-a prob-b))))) ;;(println (ref (str )))
(prob-f (ref prob-a) (str prob-b))
)
;; (defn problematic [x y z]
;; (x z))
(def prob-ast (lambda-to-ast (code problematic))) (def prob-ast (lambda-to-ast (code problematic)))
;; (def prob-asta (annotate-ast prob-ast)) ;; (def prob-asta (annotate-ast prob-ast))
;; (println (str (let [ast-func-deps (find-func-deps prob-ast '())
;; ast-typed (infer-types ast-func-deps '())
;; ast-named (generate-names (copy {}) ast-typed)
;; ast-lifetimes (calculate-lifetimes ast-named)
;; _ (println (str ast-lifetimes))
;; ;;ast-generics (visit-generic-funcs ast-lifetimes)
;; ]
;; ;;ast-lifetimes
;; ;;ast-generics
;; nil
;; )))