Carp/examples/bugs.carp

24 lines
552 B
Plaintext
Raw Normal View History

2017-10-10 14:50:47 +03:00
;; This file contains examples of unsolved bugs
2018-01-30 17:22:07 +03:00
;; (load "Debug.carp")
;; (Debug.sanitize-addresses)
2017-12-15 17:31:56 +03:00
(project-set! "printAST" "true")
2018-01-28 08:17:23 +03:00
;; This shouldn't compile:
;; (defn faulty-repeat [n inpt]
;; (let [str ""]
;; (do
;; (for [i 0 n]
;; (set! &str &(append @str @inpt)))
;; @str)))
;; (defn main []
2018-01-28 08:17:23 +03:00
;; (let [strings (faulty-repeat 20 "x")]
;; (IO.println &strings)))
2018-01-30 17:22:07 +03:00
2018-02-01 19:29:45 +03:00
;; Instantiating generic struct with ref-type fails:
(deftype (Triv a) [x a])
(defn g [] (Triv.init &123))
(defn main []
(println* &(g)))