mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-12 04:58:18 +03:00
22 lines
555 B
Plaintext
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))))))
|