mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
13 lines
292 B
Plaintext
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))))
|
|
|
|
)
|