Associative array/Iteration: Difference between revisions
Content added Content deleted
Line 7: | Line 7: | ||
{{Template:See also lists}} |
{{Template:See also lists}} |
||
<br><br> |
<br><br> |
||
=={{header|8th}}== |
|||
Iterating key,value pairs uses "m:each": |
|||
<lang Forth> |
|||
{"one": 1, "two": "bad"} |
|||
( swap . space . cr ) |
|||
m:each |
|||
</lang> |
|||
{{out}}<pre> |
|||
one 1 |
|||
two bad |
|||
</pre> |
|||
Iterating the keys uses "m:keys": |
|||
<lang Forth> |
|||
{"one": 1, "two": "bad"} m:keys |
|||
( . cr ) |
|||
a:each |
|||
</lang> |
|||
{{out}}<pre> |
|||
one |
|||
two |
|||
</pre> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |