From 87c3b28e3d2a32cf67b4d29d60d2b1df729f06c1 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 10 Mar 2018 21:38:54 +0000 Subject: net: Add (net ricketyspace sicp one fortyone). --- net/ricketyspace/sicp/one/fortyone.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 net/ricketyspace/sicp/one/fortyone.scm (limited to 'net/ricketyspace') diff --git a/net/ricketyspace/sicp/one/fortyone.scm b/net/ricketyspace/sicp/one/fortyone.scm new file mode 100644 index 0000000..df3baa9 --- /dev/null +++ b/net/ricketyspace/sicp/one/fortyone.scm @@ -0,0 +1,18 @@ +;;;; Under Creative Commons Attribution-ShareAlike 4.0 +;;;; International. See +;;;; . + +(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 + -- cgit v1.2.3