source: project/wiki/eggref/4/srfi-4-comprehensions @ 15434

Last change on this file since 15434 was 15434, checked in by felix winkelmann, 10 years ago

added wiki page for srfi-4-comprehenesion

File size: 3.3 KB
Line 
1[[tags: egg]]
2
3== srfi-4-comprehensions
4
5SRFI-42 Comprehensions for SRFI-4 Vectors
6
7The {{srfi-4-comprehensions}} extension defines comprehensions and generators (in the sense of {{http://srfi.schemers.org/srfi-42|SRFI-42}}
8for the homogeneous numeric vectors of {{http://srfi.schemers.org/srfi-4|SRFI-4}}.
9
10The syntax of these generators and comprehensions follows exactly the syntax of the {{vector-ec}}, {{vector-of-length-ec}},
11and {{:vector}} comprehensions and generator.  Include in your module using
12
13 (require-extension srfi-42 srfi-4-comprehensions)
14
15The following comprehensions are provided:
16
17 (s8vector-ec <qualifier>* <expression>)
18 (u8vector-ec <qualifier>* <expression>)
19 (s16vector-ec <qualifier>* <expression>)
20 (u16vector-ec <qualifier>* <expression>)
21 (s32vector-ec <qualifier>* <expression>)
22 (u32vector-ec <qualifier>* <expression>)
23 (s64vector-ec <qualifier>* <expression>)
24 (u64vector-ec <qualifier>* <expression>)
25 (f64vector-ec <qualifier>* <expression>)
26 (f32vector-ec <qualifier>* <expression>)
27
28 (s8vector-of-length-ec <k> <qualifier>* <expression>)
29 (u8vector-of-length-ec <k> <qualifier>* <expression>)
30 (s16vector-of-length-ec <k> <qualifier>* <expression>)
31 (u16vector-of-length-ec <k> <qualifier>* <expression>)
32 (s32vector-of-length-ec <k> <qualifier>* <expression>)
33 (u32vector-of-length-ec <k> <qualifier>* <expression>)
34 (s64vector-of-length-ec <k> <qualifier>* <expression>)
35 (u64vector-of-length-ec <k> <qualifier>* <expression>)
36 (f64vector-of-length-ec <k> <qualifier>* <expression>)
37 (f32vector-of-length-ec <k> <qualifier>* <expression>)
38
39And the following generators are provided:
40
41 (:s8vector <vars> <arg1> <arg>*)
42 (:u8vector <vars> <arg1> <arg>*)
43 (:s16vector <vars> <arg1> <arg>*)
44 (:u16vector <vars> <arg1> <arg>*)
45 (:s32vector <vars> <arg1> <arg>*)
46 (:u32vector <vars> <arg1> <arg>*)
47 (:s64vector <vars> <arg1> <arg>*)
48 (:u64vector <vars> <arg1> <arg>*)
49 (:f64vector <vars> <arg1> <arg>*)
50 (:f32vector <vars> <arg1> <arg>*)
51
52== License
53
54Derived (almost verbatim) from the code for vector comprehensions in the SRFI-42 reference implementation.  The copyright on that code is:
55
56Copyright (C) Sebastian Egner (2003). All Rights Reserved.
57
58Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
59
60The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
61
62THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
63
64Modifications are copyright (C) Will M. Farr (2006), goverened by the same conditions.
65
66== History
67
68; 1.3 : cleaned up installation script
69; 1.2 : ported to chicken 4
70; 1.0 : initial version
Note: See TracBrowser for help on using the repository browser.