This commit is contained in:
Danny Yoo 2012-02-20 13:36:05 -05:00
parent 819725c573
commit 656825be9e
4 changed files with 15 additions and 2 deletions

View File

@ -38,6 +38,7 @@
'caadr
'cdddr
'cdadr
'cadddr
'list
'list?
'list*

View File

@ -121,6 +121,11 @@
return isPair(x) && isPair(x.rest) && isPair(x.rest.rest);
},
'caddrable value');
var checkCadddrPair = baselib.check.makeCheckArgumentType(
function(x) {
return isPair(x) && isPair(x.rest) && isPair(x.rest.rest) && isPair(x.rest.rest.rest);
},
'cadddrable value');
var checkCaadrPair = baselib.check.makeCheckArgumentType(
function(x) {
return isPair(x) && isPair(x.rest) && isPair(x.rest.first);
@ -701,6 +706,13 @@
var firstArg = checkCdadrPair(M, 'cdadr', 0);
return firstArg.rest.first.rest;
});
installPrimitiveProcedure(
'cadddr',
1,
function (M) {
var firstArg = checkCadddrPair(M, 'cadddr', 0);
return firstArg.rest.rest.rest.first;
});
installPrimitiveProcedure(
'pair?',
1,

View File

@ -392,7 +392,7 @@ box?
;; cddar
caddr
cdddr
;; cadddr
cadddr
length
list*
list-ref

View File

@ -7,4 +7,4 @@
(provide version)
(: version String)
(define version "1.155")
(define version "1.156")