/usr/share/axiom-20120501/input/array1.input is in axiom-test 20120501-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | )set break resume
)spool array1.output
)set message test on
)set message auto off
)clear all
--S 1 of 9
oneDimensionalArray [i**2 for i in 1..10]
--R
--R
--R (1) [1,4,9,16,25,36,49,64,81,100]
--R Type: OneDimensionalArray(PositiveInteger)
--E 1
--S 2 of 9
a : ARRAY1 INT := new(10,0)
--R
--R
--R (2) [0,0,0,0,0,0,0,0,0,0]
--R Type: OneDimensionalArray(Integer)
--E 2
--S 3 of 9
for i in 1..10 repeat a.i := i; a
--R
--R
--R (3) [1,2,3,4,5,6,7,8,9,10]
--R Type: OneDimensionalArray(Integer)
--E 3
--S 4 of 9
map!(i +-> i ** 2,a); a
--R
--R
--R (4) [1,4,9,16,25,36,49,64,81,100]
--R Type: OneDimensionalArray(Integer)
--E 4
--S 5 of 9
reverse! a
--R
--R
--R (5) [100,81,64,49,36,25,16,9,4,1]
--R Type: OneDimensionalArray(Integer)
--E 5
--S 6 of 9
swap!(a,4,5); a
--R
--R
--R (6) [100,81,64,36,49,25,16,9,4,1]
--R Type: OneDimensionalArray(Integer)
--E 6
--S 7 of 9
sort! a
--R
--R
--R (7) [1,4,9,16,25,36,49,64,81,100]
--R Type: OneDimensionalArray(Integer)
--E 7
--S 8 of 9
b := a(6..10)
--R
--R
--R (8) [36,49,64,81,100]
--R Type: OneDimensionalArray(Integer)
--E 8
--S 9 of 9
copyInto!(a,b,1)
--R
--R
--R (9) [36,49,64,81,100,36,49,64,81,100]
--R Type: OneDimensionalArray(Integer)
--E 9
)spool
)lisp (bye)
|