RosettaCodeData/Task/Associative-array-Creation/APL/associative-array-creation-2.apl

27 lines
541 B
APL
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
⍝ Assign some names
X.this'that'
X.foo88
⍝ Access the names
X.this
that
⍝ ..or access via 'array index' syntax
X['this']
that
⍝ Or do it the array way
X.(foo)
88
⍝ GNU APL does not support multiple assoc. array indices however
X.(foo this)
VALUE ERROR
X.(foo this)
^
(sales.prices sales.quantities) (100 98.4 103.4 110.16) (10 12 8 10)
sales.revenue sales.prices +.× sales.quantities
sales.revenue
4109.6