Set: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) (Added 11l) |
m (Added a general comment at the beginning to present the sets and also the HashSets.) |
||
Line 3,511: | Line 3,511: | ||
=={{header|Nim}}== |
=={{header|Nim}}== |
||
Nim provides a set constructor which accepts elements of an ordinal type with at most 65536 values. Each element is represented by a bit. For non-ordinal elements or if the possible number of elements is too large (for instance for a set of strings or a set of 32 or 64 bits integers), the standard library provides a set constructor named HashSet. |
|||
Here is an example of usage of a set. |
|||
<lang nim>var # creation |
<lang nim>var # creation |
||
s = {0,3,5,10} |
s = {0, 3, 5, 10} |
||
t = {3..20, 50..55} |
t = {3..20, 50..55} |
||