Associative array/Iteration: Difference between revisions
Content deleted Content added
GP |
|||
Line 1,650:
{ForAll {Record.arity MyMap} Show} %% keys
{ForAll {Record.toList MyMap} Show} %% values</lang>
=={{header|PARI/GP}}==
{{works with|PARI/GP|2.8.1+}}
The keys can be retried from a map with Vec:
<lang parigp>keys = Vec(M);</lang>
You can iterate over the values as usual:
<lang parigp>for(i=1,#keys,
print(keys[i]," ",mapget(M,keys[i]))
)</lang>
=={{header|Perl}}==
|