mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
19 lines
423 B
Plaintext
19 lines
423 B
Plaintext
(use Array)
|
|
(Project.no-echo)
|
|
|
|
(deftype Age [x Int])
|
|
|
|
(defmodule Age
|
|
(defn = [a b]
|
|
(= (Age.x a) (Age.x b)))
|
|
(defn > [a b]
|
|
(> (Age.x a) (Age.x b)))
|
|
(defn < [a b]
|
|
(< (Age.x a) (Age.x b))))
|
|
|
|
(defn main []
|
|
(let-do [ints (Array.sort [10 3 75 40])
|
|
ages (Array.sort [(Age.init 10) (Age.init 3) (Age.init 75) (Age.init 40)])]
|
|
(IO.println &(Array.str &ints))
|
|
(IO.println &(Array.str &ages))))
|