;; This file contains examples of unsolved bugs (load "Debug.carp") (Debug.sanitize-addresses) (project-set! "printAST" "true") ;; This shouldn't compile: ;; (defn faulty-repeat [n inpt] ;; (let [str ""] ;; (do ;; (for [i 0 n] ;; (set! str &(append @str @inpt))) ;; @str))) ;; (defn main [] ;; (let [strings (faulty-repeat 20 "x")] ;; (IO.println &strings))) ;; ;; Dangling reference to member variable. ;; (deftype S [f String]) ;; (defn main [] ;; (let [s (S.init @"hello") ;; r (S.f &s) ;; _ (S.set-f s @"bye")] ;; (IO.println r))) ;; ;; Dangling reference to variable. ;; (defn main [] ;; (let [s @"hello" ;; r &s] ;; (do (String.delete s) ;; (IO.println r)))) ;; Problem with string deallocation in branches. (defn ifmem [] (if true (IO.println &@"TEST") ()))