From 372103a3ee195189b8a3ca2ad27bf82702f567a7 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Tue, 24 May 2022 17:29:06 -0400 Subject: [PATCH] Add or and and --- src/ludus/prelude.clj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ludus/prelude.clj b/src/ludus/prelude.clj index 51817a3..d2e70c3 100644 --- a/src/ludus/prelude.clj +++ b/src/ludus/prelude.clj @@ -3,10 +3,20 @@ [ludus.data :as data] [ludus.show])) +(defn- id [x] x) + (def eq {:name "eq" ::data/type ::data/clj :body =}) +(def and- {:name "and" + ::data/type ::data/clj + :body (fn [&args] (every? id &args))}) + +(def or- {:name "or" + ::data/type ::data/clj + :body (fn [&args] (some id &args))}) + (def add {:name "add" ::data/type ::data/clj :body +}) @@ -78,4 +88,6 @@ "show" show "deref" deref- "set!" set!- + "and" and- + "or" or- }) \ No newline at end of file