summaryrefslogtreecommitdiff
path: root/module/srfi/srfi-1.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-08-27 12:51:47 +0200
committerLudovic Courtès <ludo@gnu.org>2010-08-27 18:59:42 +0200
commitd7418e60a5b427a9d733929cf6ff468402dada1d (patch)
tree2ce8cc309d5ee2127bfeba486dba7d512831830b /module/srfi/srfi-1.scm
parentea975f72cf4c041cf0b0ca3be3955f70868d8380 (diff)
downloadguile-d7418e60a5b427a9d733929cf6ff468402dada1d.tar.gz
SRFI-1: Rewrite `fifth', `sixth', etc. in Scheme.
This partially reverts commit 03731332d5dc8d650b947f5126427402c2b1d8bb (Tue May 3 2005). * module/srfi/srfi-1.scm (fifth, sixth, seventh, eighth, ninth, tenth): New procedures. * srfi/srfi-1.c (scm_srfi1_fifth, scm_srfi1_sixth, scm_srfi1_seventh, scm_srfi1_eighth, scm_srfi1_ninth, scm_srfi1_tenth): Rewrite as proxies to the corresponding Scheme procedure. * test-suite/tests/srfi-1.test ("eighth")["() -1"]: Change exception type to `exception:wrong-type-arg'. ("fifth")["() -1"]: Likewise. ("ninth")["() -1"]: Likewise. ("seventh")["() -1"]: Likewise. ("sixth")["() -1"]: Likewise. ("tenth")["() -1"]: Likewise.
Diffstat (limited to 'module/srfi/srfi-1.scm')
-rw-r--r--module/srfi/srfi-1.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/srfi/srfi-1.scm b/module/srfi/srfi-1.scm
index 27aa39e6f..54008146e 100644
--- a/module/srfi/srfi-1.scm
+++ b/module/srfi/srfi-1.scm
@@ -336,6 +336,12 @@ end-of-list checking in contexts where dotted lists are allowed."
(define second cadr)
(define third caddr)
(define fourth cadddr)
+(define (fifth x) (car (cddddr x)))
+(define (sixth x) (cadr (cddddr x)))
+(define (seventh x) (caddr (cddddr x)))
+(define (eighth x) (cadddr (cddddr x)))
+(define (ninth x) (car (cddddr (cddddr x))))
+(define (tenth x) (cadr (cddddr (cddddr x))))
(define (car+cdr x)
"Return two values, the `car' and the `cdr' of PAIR."