summaryrefslogtreecommitdiffstats
path: root/net/ricketyspace/sicp/one/fortyone.scm
blob: df3baa91a7b80e84e0681b9552f38cd228c38000 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;;;; Under Creative Commons Attribution-ShareAlike 4.0
;;;; International. See
;;;; <https://creativecommons.org/licenses/by-sa/4.0/>.

(define-module (net ricketyspace sicp one fortyone)
  #:export (double inc))

(define (double func)
  (lambda (x) (func (func x))))

(define (inc x) (1+ x))

;;; GNU Guile REPL

;;; scheme@(guile-user)> ,use (net ricketyspace sicp one fortyone)
;;; scheme@(guile-user)> (((double (double double)) inc) 5)
;;; $9 = 21