source: project/wiki/eggref/5/srfi-47 @ 39298

Last change on this file since 39298 was 39298, checked in by gnosis, 2 months ago

Initial revision of SRFI-47 documentation

File size: 2.4 KB
Line 
1[[tags: egg]]
2
3== srfi-47
4
5[[toc:]]
6
7=== Description
8
9An alternative arrays package conforming to [[http://srfi.schemers.org/srfi-47/srfi-47.html|SRFI-47]].
10
11=== Author
12
13* Aubrey Jaffer, ported to Chicken by [[/users/felix winkelmann|felix winkelmann]]
14* Ported to Chicken 5 by Sergey Goldgaber
15
16=== Requirements
17
18None
19
20=== Documentation
21
22The full specification can be found at
23[[http://srfi.schemers.org/srfi-47/srfi-47.html|the SRFI website]].
24The array prototypes for complex numbers are not supported
25({{ac64}}). The 64-bit signed and unsigned array prototypes {{au64}}
26and {{as64}}) are provided but may not support the full range of
27numerical values on 32-bit architevtures.
28
29Additionally, the following procedure is defined:
30
31<procedure>(array-store ARRAY)</procedure>
32
33Returns the underlying storage object, which may be a vector or a
34[[http://srfi.schemers.org/&srfi/srfi-4.html|SRFI-4]] number vector.
35
36Note: this array package is ''not'' compatible with the default array
37library ({{srfi-25}}) that is provided with the base system. Don't use
38these two libraries together in the same program.
39
40=== Examples
41
42<enscript highlight="scheme">
43(use srfi-47)
44
45(define fred (make-array '#(#f) 8 8))
46(define freds-diagonal
47  (make-shared-array fred (lambda (i) (list i i)) 8))
48(array-set! freds-diagonal 'foo 3)
49(array-ref fred 3 3)
50 => foo
51
52(define freds-center
53  (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j)))
54                     2 2))
55(array-ref freds-center 0 0)
56 => foo
57</enscript>
58
59=== Changelog
60
61* [[https://github.com/diamond-lizard/srfi-47/releases/tag/2.0|2.0]] - Ported to Chicken Scheme 5
62* 1.1 Fixed invalid implementation of {{array?}} [Thanks to Kon Lovett]
63* 1.0 Initial release
64
65=== License
66
67  Copyright (C) 2001, 2003 Aubrey Jaffer
68 
69  Permission to copy this software, to modify it, to redistribute it,
70  to distribute modified versions, and to use it for any purpose is
71  granted, subject to the following restrictions and understandings.
72 
73  1.  Any copy made of this software must include this copyright notice
74  in full.
75 
76  2.  I have made no warranty or representation that the operation of
77  this software will be error-free, and I am under no obligation to
78  provide any services, by way of maintenance, update, or otherwise.
79 
80  3.  In conjunction with products arising from the use of this
81  material, there shall be no use of my name in any advertising,
82  promotional, or sales literature without prior written consent in
83  each case.
Note: See TracBrowser for help on using the repository browser.