1Array.range(3kaya) Kaya module reference Array.range(3kaya)
2
3
4
6 Array::range - Get a range of integers
7
9 [Int] range( Int first, Int last, Int step=1 )
10
12 first The first value in the returned array
13
14 last The limit of the last value in the returned array
15
16 step The difference between adjacent values (cannot be zero!). This
17 argument is optional and defaults to 1.
18
20 Return an array of values from [ first
21
22 last ], incrementing by step
23
24
25
26 xs = range(1,5); // [1,2,3,4,5]
27 xs = range(1,5,2); // [1,3,5]
28 xs = range(1,5,3); // [1,4]
29 xs = range(8,4,-1); // [8,7,6,5,4]
30
31 The usual way of calling the range function is using the [first..last]
32 or [first,second..last] syntax.
33
34
35 xs = [1..5]; // [1,2,3,4,5]
36 xs = [1,3..5]; // [1,3,5]
37 xs = [1,4..5]; // [1,4]
38 xs = [8,7..4]; // [8,7,6,5,4]
39
41 Kaya standard library by Edwin Brady, Chris Morris and others
42 (kaya@kayalang.org). For further information see http://kayalang.org/
43
45 The Kaya standard library is free software; you can redistribute it
46 and/or modify it under the terms of the GNU Lesser General Public
47 License (version 2.1 or any later version) as published by the Free
48 Software Foundation.
49
50
51
52Kaya December 2010 Array.range(3kaya)