apl>" <-APL2-------------------- sam283.txt ---------------------------->
apl>" <- Name and Symbol binding (pp 34-35) ---------------------------->
apl>a#2 3RI6
apl>b#3 2RI6
apl>c#2 2RI4
apl>+.X/a b c
106 156
241 354
apl>(+.X)/(a b c)
106 156
241 354
apl>" <- The following generates an error ----------------------------->
apl>+.(X/(a b c))
+.(X/(a b c))
^ 63 - missing operator/function during execute processing.
apl>" <----------------------------------------------------------------->
apl>2 1 3 / 2 3 4
2 2 3 4 4 4
apl>1 2 + 3 4
4 6
apl>(2 1 3) / (2 3 4)
2 2 3 4 4 4
apl>(1 2) + (3 4)
4 6
apl>+.X/(1 2 3) (4 5 6) (7 8 9)
732
apl>+.(X/(1 2 3) (4 5 6) (7 8 9))
+.(X/(1 2 3) (4 5 6) (7 8 9))
^ 63 - missing operator/function during execute processing.
apl>(+.X)/(1 2 3) (4 5 6) (7 8 9)
732
apl>1++.X/(1 2 3) (4 5 6) (7 8 9)
733
apl>2 3 X 4 5 + 6 7
20 36
apl>2 3 X (4 5 + 6 7)
20 36
apl>(2 3 X 4 5) + 6 7
14 22
apl>.3 .2 .1 +[1] m # 3 4 R I 12
1.3 2.3 3.3 4.3
5.2 6.2 7.2 8.2
9.1 10.1 11.1 12.1
apl>.3 .2 .1 + m # 3 4 R I 12
.3 .2 .1 + m # 3 4 R I 12
^ 17 - dyadic function arguments are not conformable.
apl>" <----------------------------------------------------------------->
apl>a#(1 2 3) (4 5 6) (7 8 9)
apl>(Ya)#'abc'
apl>a
abc 4 5 6 7 8 9
apl>((,a)[3])#'xy'
apl>a
abc 4 5 6 7 8 9
apl>a#b#(2 3)(2 3 4 5)(10 20)
apl>3Y2`Xa
2 3 4
apl>(3Y2`Xa)#'abc'
apl>a
2 3 abc 5 10 20
apl>4Y2`Xb
2 3 4 5
apl>(4Y2`Xb)#2 3 4
apl>b
2 3 2 3 4 2 3 4 2 3 4 2 3 4 10 20
apl>a#b#c#(2 3)(4 5 6 7)(8 9)
apl>Ya
2 3
apl>1`Xb
2 3
apl>(Ya)`=1`Xb
1
apl>(Ya)#10 11 12
apl>a
10 11 12 4 5 6 7 8 9
apl>(1`Xb)#10 11 12
apl>b
10 11 12 4 5 6 7 8 9
apl>(4Y2`Xc)#10 11 12
apl>c
2 3 10 11 12 8 9
apl>a#'abcd'
apl>((I0)`Xa)#10 20 30
apl>a
10 20 30
apl>" <----------------------------------------------------------------->
apl>a#0RL#a#(2 3)(4 5 6 7)(8 9)
2 3 4 5 6 7 8 9
apl>Ya
0 0
apl>" <----------------------------------------------------------------->
apl>k#2 3R.1XI6
apl>j#2 3 4RI24
apl>j+[1 2]k
1.1 2.1 3.1 4.1
5.2 6.2 7.2 8.2
9.3 10.3 11.3 12.3
13.4 14.4 15.4 16.4
17.5 18.5 19.5 20.5
21.6 22.6 23.6 24.6
apl>(j+[1 2]k)`=j+[1 2]k
1
apl>" <----------------------------------------------------------------->
apl>Gz # m binom n
[1] a # m!n
[2] b # (!n) % (!m) X (!n_m)
[3] z # T (a = b),[1]a,[.5]b
[4] G
apl>3 binom 6
1 20 20
apl>2 3 4 2 binom 6 18 24 5
1 15 15
1 816 816
1 10626 10626
1 10 10
apl>2 3 4 2 ! 6 18 24 5
15 816 10626 10
apl>Gz # m binom n
z # m binom n
^ 115 - del editor found function name already in use.
apl>a # m!n
a # m!n
^ 59 - argument not found where expected during execute.
apl>b # (!n) % (!m) X ! n _ m
b # (!n) % (!m) X ! n _ m
^ 59 - argument not found where expected during execute.
apl>c # (!n) % (!m) X _ m
c # (!n) % (!m) X _ m
^ 70 - missing right argument during execute.
apl>z # T (a = b),[1]a,[1]b,[.5]c
z # T (a = b),[1]a,[1]b,[.5]c
^ 50 - shapes of left and right must match in laminate.
apl>G
apl>3 binom 6
1 20 20
apl>2 3 4 2 binom 6 18 24 5
1 15 15
1 816 816
1 10626 10626
1 10 10
apl>Gz # l bineg r
[1] a # l ! r
[2] b # (-1*r_l)X(_r+1)!(_l+1)
[3] z # T a,[.5]b
[4] G
apl>((4R-5),(3R-4),(2R-3),-2) bineg -4 -3 -2 -1 -3 -2 -1 -2 -1 -1
-4 -4
6 6
-4 -4
1 1
-3 -3
3 3
-1 -1
-2 -2
1 1
-1 -1
apl>((4R-5),(3R-4),(2R-3),-2) ! -4 -3 -2 -1 -3 -2 -1 -2 -1 -1
-4 6 -4 1 -3 3 -1 -2 1 -1
apl>a#-6+I11
apl>a J.! a
1 -4 6 -4 1 0 0 0 0 0 0
0 1 -3 3 -1 0 0 0 0 0 0
0 0 1 -2 1 0 0 0 0 0 0
0 0 0 1 -1 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1
-5 -4 -3 -2 -1 0 1 2 3 4 5
15 10 6 3 1 0 0 1 3 6 10
-35 -20 -10 -4 -1 0 0 0 1 4 10
70 35 15 5 1 0 0 0 0 1 5
-126 -56 -21 -6 -1 0 0 0 0 0 1
apl>)off