Skip to content

Instantly share code, notes, and snippets.

@athos
athos / deps.edn
Last active June 21, 2023 00:15
Try on your terminal `clojure -Sdeps '{:deps {hello-clojure/hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :git/sha "099bdf7d565b2c35c1df601abf58514cc5276237"}}}' -M -m hello-clojure`
{:paths ["."]
:deps {clansi/clansi {:mvn/version "1.0.0"}}}
@frenchy64
frenchy64 / part1.clj
Created October 8, 2011 20:11
Evolving a logic programming language
;; Evolving a logic programming language
;; Based on sketches at https://github.com/frenchy64/Logic-Starter/blob/master/src/logic_introduction/decl_model.clj
;; A logic statement reduces to true or false.
true
;=> true
false
;=> false
(def-->e verb [v]
([[:v 'eats]] '[eats]))
(def-->e noun [n]
([[:n 'bat]] '[bat])
([[:n 'cat]] '[cat]))
(def-->e det [d]
([[:d 'the]] '[the])
([[:d 'a]] '[a]))
@pepijndevos
pepijndevos / test.clj
Created April 21, 2011 15:30
Alternative implementation of clojure.core/seque
(ns test
(:import [java.util.concurrent
BlockingQueue
LinkedBlockingQueue
SynchronousQueue
PriorityBlockingQueue
CyclicBarrier])
(:use clojure.test)
(:refer-clojure :exclude [seque]))
@rlm
rlm / gist:746185
Created December 18, 2010 05:19
curry.clj
(ns sunil.curry)
(defn partial+
"Takes a function f and fewer than the normal arguments to f, and
returns a fn that takes a variable number of additional args. When
called, the returned function calls f with args + additional args.
differs from the core version in that it works on just one argument."
{:added "1.0"}
([f] f)
([f arg1]