Carp/examples/copying.carp

18 lines
314 B
Plaintext
Raw Normal View History

2017-09-05 12:43:33 +03:00
(import Array)
;;(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-05 15:11:18 +03:00
(import C)
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)]
2017-09-05 14:49:53 +03:00
(IO.println &"OK.")))