Thursday, March 07, 2019

SICP in Clojure: Chapter 1, Exercise 5

This is my Clojure solution to Chapter 1, Exercise 5:

(ns sicp.ch1.ex05)

(defn p
  []
  (p))

(defn test-order
  [x y]
  (if (zero? x)
    0
    y))

(test-order 6 (p)) ; => applicative order

No comments: