Icon+Unicon/Intro: Difference between revisions
Content added Content deleted
m (→Tables) |
|||
Line 120: | Line 120: | ||
==== Tables ==== |
==== Tables ==== |
||
Tables (mutable) are structures where values are indexed by unique keys. Syntactically they look a lot like lists indexed by arbitrary values. Tables are one of the most powerful features of Icon/Unicon. |
Tables (mutable) are structures where values are indexed by unique keys. Syntactically they look a lot like lists indexed by arbitrary values. Tables are one of the most commonly used and powerful features of Icon/Unicon. |
||
<lang Icon> T := table(0) # table with default 0 values |
<lang Icon> T := table(0) # table with default 0 values |
||
every T[!words] +:= 1 # counts words</lang> |
every T[!words] +:= 1 # counts words</lang> |