You are looking at historical revision 9662 of this page. It may differ significantly from its current revision.



An alternative arrays package conforming to SRFI-47.


Aubrey Jaffer, ported to Chicken by felix winkelmann






The full specification can be found at the SRFI website. The array prototypes for complex numbers are not supported (ac64). The 64-bit signed and unsigned array prototypes au64 and as64) are provided but may not support the full range of numerical values on 32-bit architevtures.

Additionally, the following procedure is defined:

[procedure] (array-store ARRAY)

Returns the underlying storage object, which may be a vector or a SRFI-4 number vector.

Note: this array package is not compatible with the default array library (srfi-25) that is provided with the base system. Don't use these two libraries together in the same program.


<example> <init>(use srfi-47)</init> <expr> (define fred (make-array '#(#f) 8 8)) (define freds-diagonal

 (make-shared-array fred (lambda (i) (list i i)) 8))

(array-set! freds-diagonal 'foo 3) (print (array-ref fred 3 3)) </expr> <output>foo</output> <expr> (define freds-center

 (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j)))
                    2 2))

(print (array-ref freds-center 0 0)) </expr> <output>foo</output> <example>



 Copyright (C) 2001, 2003 Aubrey Jaffer
 Permission to copy this software, to modify it, to redistribute it,
 to distribute modified versions, and to use it for any purpose is
 granted, subject to the following restrictions and understandings.
 1.  Any copy made of this software must include this copyright notice
 in full.
 2.  I have made no warranty or representation that the operation of
 this software will be error-free, and I am under no obligation to
 provide any services, by way of maintenance, update, or otherwise.
 3.  In conjunction with products arising from the use of this
 material, there shall be no use of my name in any advertising,
 promotional, or sales literature without prior written consent in
 each case.