summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2018-03-10 21:38:54 +0000
committerrsiddharth <s@ricketyspace.net>2018-03-10 21:38:54 +0000
commit87c3b28e3d2a32cf67b4d29d60d2b1df729f06c1 (patch)
treebc4c7249b757b03e2452a23c2cf974160c534dd6
parent8839af0454b86a84af00b782bf22de82c67525e3 (diff)
net: Add (net ricketyspace sicp one fortyone).
-rw-r--r--net/ricketyspace/sicp/one/fortyone.scm18
1 files changed, 18 insertions, 0 deletions
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
+;;;; <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
+