This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This uses only fn and def in Clojure to create non-negative integers and pairs. | |
; (This restricts the language to only using lambda calculus.) | |
; Church numerals | |
(defn succ [n] | |
(fn [f] | |
(fn [x] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (contains-cycle? lst) | |
(let inner ((a (nil-safe-cdr lst)) | |
(b (nil-safe-cdr (nil-safe-cdr lst)))) | |
(cond ((or (not (pair? a)) | |
(not (pair? b))) #f) | |
((or (eq? a b) | |
(eq? a (nil-safe-cdr b))) #t) | |
(else (inner (nil-safe-cdr a) (nil-safe-cdr (nil-safe-cdr b))))))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kcat -b localhost:29092 -t catchall_legacy -P -l test_events.jsonl |
OlderNewer