Skip to content

Commit 27d8311

Browse files
use exception-continue for z-combinator
1 parent db58156 commit 27d8311

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

clay.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
:format [:quarto :html]
1717
:run-quarto false
1818
:hide-info-line false
19-
:quarto ^:replace {}}}
19+
:quarto []}}

deps.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
:jvm-opts ["-Dclojure.main.report=stderr"]}
2727
;; When debugging libraries
2828
:local-deps {:override-deps {org.scicloj/clay {:local/root "../clay"}
29+
org.scicloj/kindly {:local/root "../kindly"}
2930
org.scicloj/kindly-advice {:local/root "../kindly-advice"}}}
3031
:neil {:project {:name io.github.timothypratley/clojurecivitas}}}}

src/code_interview/beating/with_stupid_stuff/z_combinator_gambit.clj

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
:date "2025-05-25"
77
:category :clojure
88
:tags [:lambda-calculus :code-interview]
9-
:keywords [:z-combinator]}}}
9+
:keywords [:z-combinator]}
10+
:exception-continue true}}
1011
(ns code-interview.beating.with-stupid-stuff.z-combinator-gambit
1112
(:require [clojure.print-object.remove-extraneous]))
1213

@@ -69,10 +70,8 @@
6970
[]
7071
(conj (SELF (rest LIST))
7172
(first LIST))))))
72-
;; ```clojure
73-
;; ((REV' REV') [1 2 3 4 5])
74-
;; ```
75-
;; **error**
73+
74+
((REV' REV') [1 2 3 4 5])
7675

7776
;; Oh, no...
7877
;; `SELF` doesn't take `LIST`,
@@ -130,10 +129,7 @@
130129

131130
;; > Well, it's a function! That much is clear...
132131

133-
;; ```clojure
134-
;; ((REV-LOGIC REV-LOGIC) [1 2 3 4 5])
135-
;; ```
136-
;; **Error**
132+
((REV-LOGIC REV-LOGIC) [1 2 3 4 5])
137133

138134
;; But it doesn't work, because `(REV-LOGIC REV-LOGIC) =/= REV-LOGIC.`
139135
;; Let's try something easier:
@@ -185,10 +181,7 @@
185181

186182
;; Because `(FIX F) = ((FIX F) (FIX F))`, it was your idea to refactor remember?
187183

188-
;; ```clojure
189-
;; (FIX REV-LOGIC)
190-
;; ```
191-
;; **stack overflow**
184+
(FIX REV-LOGIC)
192185

193186
;; > Everything looks to be inside out now.
194187

@@ -292,10 +285,7 @@
292285

293286
;; But test not the serpent lightly
294287

295-
;; ```clojure
296-
;; (REPLICATE REPLICATE)
297-
;; ```
298-
;; **stack overflow**
288+
(REPLICATE REPLICATE)
299289

300290
;; The replication of replication is eternal.
301291
;; Now we can clean up that duplication.

0 commit comments

Comments
 (0)