Associative array/Merging: Difference between revisions
→{{header|ALGOL 68}}: Minor update to the associative array MODEs etc.
(added Ol) |
(→{{header|ALGOL 68}}: Minor update to the associative array MODEs etc.) |
||
Line 48:
Uses the associative array implementations in [[ALGOL_68/prelude]].
<lang algol68># associative array merging #
# the modes allowed as associative array element values - change to suit #
MODE AAVALUE = UNION( STRING, INT, REAL );
# the modes allowed as associative array element keys - change to suit #
MODE AAKEY = STRING;
# initial value for an array element #
AAVALUE init element value = "";
# include the associative array code #
PR read "aArrayBase.a68" PR
# adds or replaces all elements from b into a #
PRIO UPDATE = 9;
Line 68 ⟶ 70:
a
END # UPDATE # ;
# construct the associative arrays for the task #
REF AARRAY a := INIT LOC AARRAY;
|