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

22 lines
455 B
APL
Raw Permalink Normal View History

2013-04-10 14:58:50 -07:00
⍝ Create a namespace ("hash")
X⎕NS
⍝ Assign some names
X.this'that'
X.foo88
⍝ Access the names
X.this
that
⍝ Or do it the array way
X.(foo this)
88 that
⍝ Namespaces are first class objects
sales ⎕NS
sales.(prices quantities) (100 98.4 103.4 110.16) (10 12 8 10)
sales.(revenue prices +.× quantities)
sales.revenue
4109.6