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
| (defn one [[x & xs]] | |
| (when x | |
| (if (zero? x) | |
| (cons 1 (zero xs)) | |
| (cons 0 (one xs))))) | |
| (defn zero [[x & xs]] | |
| (when x | |
| (if (zero? x) | |
| (cons 0 (zero xs)) |
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
| (ns lambda.core-test | |
| (:require [clojure.test :refer :all])) | |
| ;; A walktrough λ-calculus with Clojure | |
| ;; based on Greg Michaelson book "An introduction to to functional programming through lambda calculus" | |
| ;; !!! DISCLAIMER !!! | |
| ;; ------------------ | |
| ;; This document is 100% based on Greg Michaelson's book. |