Impressum/Kontaktparent nodes: implemented functions

^ And

testAplAnd
| result table |
"http://www.microapl.co.uk/apl_help/ch_020_020_430.htm"

"dataA aplAnd: dataB"

"Compares two arguments which must consist only of 0's and 1's. If both elements compared are 1's, the result for that comparison is 1. Otherwise the result for that comparison is 0."
self assert: true asApl = (1 asApl aplAnd: 1).
self assert: false asApl = (1 asApl aplAnd: 0).
self assert: false asApl = (false asApl aplAnd: 0).

"Each element in a vector is compared with the corresponding element in a vector of equal size"
result := #(false false false true false) asApl.
self assert: result = (#(0 0 0 1 1) asApl aplAnd: #(1 1 1 1 0) asApl).

"Each element in a matrix is compared with 1"
result := #( true true true false false false true false true) aplReshape:#(3 3).
table := #(1 1 1 0 0 0 1 0 1) aplReshape:#(3 3).
self assert: result = (1 asApl aplAnd:table).

"Applies aplAnd to each row of the matrix. A 1 in the result shows that the corresponding line contained only 1's"
result := #(true false false) asApl.
self assert: result = (table aplReduce:#aplAnd:).

"The result is all 0's after the first 0"
result := #(true true true false false false false false false) asApl.

"on aplScan the first element is unchanged (so its an integer 1, not an AplTrue)"
self assert: result = (#(1 1 1 0 1 0 1 0 1) asApl asAplBoolean aplScan:#aplAnd:).