From 73ef53b87b5756e9fcb45f5c2851431a7c8d1422 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Fri, 9 Nov 2018 20:14:55 -0500 Subject: net: Add (net ricketyspace sicp two seventeen). --- net/ricketyspace/sicp/two/seventeen.scm | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 net/ricketyspace/sicp/two/seventeen.scm (limited to 'net') diff --git a/net/ricketyspace/sicp/two/seventeen.scm b/net/ricketyspace/sicp/two/seventeen.scm new file mode 100644 index 0000000..0c6180c --- /dev/null +++ b/net/ricketyspace/sicp/two/seventeen.scm @@ -0,0 +1,8 @@ +;;;; License: CC0-1.0 + +(define-module (net ricketyspace sicp two seventeen) + #:export (sicp-last-pair)) + +(define (sicp-last-pair items) + (cond ((= (length items) 1) items) + (else (sicp-last-pair (cdr items))))) -- cgit v1.2.3