Carp/core/Tuples.carp
2018-06-01 11:18:34 +02:00

13 lines
292 B
Plaintext

(deftype (Pair a b) [a a b b])
(defmodule Pair
(defn init-from-refs [r1 r2]
(Pair.init @r1 @r2))
;; BUG: Can't define this function because = resolves to Pair.= in the body.
;; (defn = [p1 p2]
;; (and (= (Pair.a p1) (Pair.a p2))
;; (= (Pair.b p1) (Pair.b p2))))
)