Carp/examples/bugs.carp
2018-01-30 15:22:07 +01:00

22 lines
555 B
Plaintext

;; 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)))
(deftype (Trivial t) [thing t, num Int])
(defn f [x]
(IO.println &(str @(Trivial.num (Trivial.thing &(the (Trivial (Trivial String)) x))))))