Jump to content

Associative array/Iteration: Difference between revisions

GP
(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}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.