[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proposal: make-list

Random-access lists are often used as functional vectors, hence vector-like constructors may be useful. In particular, a random-access version of `make-list' can construct lists represented in a very space efficient manner, O(log n), thanks to sharing. I propose the following be added to SRFI 101. I'm on the fence about whether the unary `make-list' is useful, though. Comments welcome.


(make-list k)            procedure
(make-list k fill)       procedure

Returns a newly allocated list of k elements. If a second argument is given, then each element is initialized to fill. Otherwise the initial contents of each element is unspecified.