Carp/examples/copying.carp

22 lines
330 B
Plaintext
Raw Normal View History

2017-09-06 11:05:19 +03:00
(use Array)
2017-09-05 12:43:33 +03:00
;;(deftype Mini [m String])
2017-09-05 12:43:33 +03:00
(deftype C [a String
b (Array Int)
;;m Mini
])
2017-09-05 14:49:53 +03:00
2017-09-06 11:05:19 +03:00
(use C)
2017-09-05 15:11:18 +03:00
2017-09-05 14:49:53 +03:00
(defn main []
(let [c1 (C.init @"Hej" [1 2 3])
2017-09-05 15:11:18 +03:00
c2 (C.copy &c1)
a1 [(C.copy &c2) (C.copy &c2) (C.copy &c2)]
a2 (copy &a1)]
(IO.println "OK.")))
2017-09-08 13:24:57 +03:00
(build)
(run)
(quit)