sicp

sicp sandbox.
git clone git://git.ricketyspace.net/sicp.git
Log | Files | Refs

commit 87c3b28e3d2a32cf67b4d29d60d2b1df729f06c1
parent 8839af0454b86a84af00b782bf22de82c67525e3
Author: rsiddharth <s@ricketyspace.net>
Date:   Sat, 10 Mar 2018 21:38:54 +0000

net: Add (net ricketyspace sicp one fortyone).

Diffstat:
net/ricketyspace/sicp/one/fortyone.scm | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/net/ricketyspace/sicp/one/fortyone.scm 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 +