function application works with lifetimes and borrow checker

This commit is contained in:
Erik 2016-01-17 23:44:23 +01:00
parent 60174d329c
commit 9865fd0e0b
2 changed files with 6 additions and 1 deletions

View File

@ -54,7 +54,9 @@
(let [ast (:ast data)
vars (:vars data)
pos (:pos data)
new-data (calculate-lifetimes-internal {:ast arg-ast :vars vars})
new-data (if (and (= :literal (:node arg-ast)) (not (ref? arg-ast)))
{:ast arg-ast :vars vars} ;; a literal as an arg to a non-ref parameter doesn't create any new vars to free
(calculate-lifetimes-internal {:ast arg-ast :vars vars}))
new-arg-ast (:ast new-data)
new-vars (:vars new-data)
;;_ (println (str "AST: " ast))

View File

@ -191,6 +191,9 @@
(defn own-string-5 (s)
(strlen s))
(defn own-string-6 (s)
(strlen (ref s)))
;;(bake own-string-1)
;;(bake own-string-2)
;;(bake own-string-3)