added missing definition for list*

This commit is contained in:
Danny Yoo 2011-07-28 17:17:01 -04:00
parent c7dd5cc99c
commit 7e3baee864
3 changed files with 20 additions and 7 deletions

View File

@ -846,6 +846,19 @@ if(this['plt'] === undefined) { this['plt'] = {}; }
return result;
});
installPrimitiveProcedure(
'list*',
plt.baselib.arity.makeArityAtLeast(1),
function(MACHINE) {
var result = checkList(MACHINE, 'list*', MACHINE.argcount - 1);
for (var i = MACHINE.argcount - 2; i >= 0; i--) {
result = makePair(MACHINE.env[MACHINE.env.length - 1 - i],
result);
}
return result;
});
installPrimitiveProcedure(
'list-ref',
2,

View File

@ -300,7 +300,7 @@ exact?
;; cdddr
;; cadddr
length
;; list*
list*
list-ref
;; list-tail
append

View File

@ -52,9 +52,9 @@
(apply * `(,x ,(apply f (apply sub1 (apply list x '())) '())))]))
(f 0)
;(f 1)
;(f 2)
;(f 3)
;(f 4)
;(f 5)
;(+ (f 4) (f 5))
(f 1)
(f 2)
(f 3)
(f 4)
(f 5)
(+ (f 4) (f 5))