From: Chris Hanson Date: Fri, 3 Mar 1995 23:40:44 +0000 (+0000) Subject: Implement MAKE-INITIALIZED-LIST. X-Git-Tag: 20090517-FFI~6566 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d0b77f4bcdcf4d39b6c6999baea0a86275b13a8c;p=mit-scheme.git Implement MAKE-INITIALIZED-LIST. --- diff --git a/v7/src/runtime/list.scm b/v7/src/runtime/list.scm index 23e6f2188..36cf54f37 100644 --- a/v7/src/runtime/list.scm +++ b/v7/src/runtime/list.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: list.scm,v 14.19 1994/02/16 07:57:01 gjr Exp $ +$Id: list.scm,v 14.20 1995/03/03 23:40:17 cph Exp $ Copyright (c) 1988-93 Massachusetts Institute of Technology @@ -79,6 +79,14 @@ MIT in each case. |# result) (loop (- n 1) (cons value result)))))) '())) + +(define (make-initialized-list length initialization) + (guarantee-index length 'MAKE-INITIALIZED-LIST) + (let loop ((index (- length 1)) (result '())) + (if (negative? index) + result + (loop (- index 1) + (cons (initialization index) result))))) (define (list-ref list index) (let ((tail (list-tail list index))) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index e98e31ab5..f7417f7ff 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.248 1995/03/01 21:58:07 adams Exp $ +$Id: runtime.pkg,v 14.249 1995/03/03 23:40:44 cph Exp $ Copyright (c) 1988-95 Massachusetts Institute of Technology @@ -1212,6 +1212,7 @@ MIT in each case. |# list? make-list make-circular-list + make-initialized-list map map* mapcan diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index e98e31ab5..f7417f7ff 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.248 1995/03/01 21:58:07 adams Exp $ +$Id: runtime.pkg,v 14.249 1995/03/03 23:40:44 cph Exp $ Copyright (c) 1988-95 Massachusetts Institute of Technology @@ -1212,6 +1212,7 @@ MIT in each case. |# list? make-list make-circular-list + make-initialized-list map map* mapcan