File tree Expand file tree Collapse file tree 3 files changed +9
-18
lines changed
src/code_interview/beating/with_stupid_stuff Expand file tree Collapse file tree 3 files changed +9
-18
lines changed Original file line number Diff line number Diff line change 1616 :format [:quarto :html ]
1717 :run-quarto false
1818 :hide-info-line false
19- :quarto ^:replace {} }}
19+ :quarto [] }}
Original file line number Diff line number Diff line change 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}}}}
Original file line number Diff line number Diff line change 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
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`,
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:
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
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.
You can’t perform that action at this time.
0 commit comments