mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-11 04:27:55 +03:00
function application works with lifetimes and borrow checker
This commit is contained in:
parent
60174d329c
commit
9865fd0e0b
@ -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))
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user