diff options
Diffstat (limited to 'doc/colm/2_02_list_map_struct_alias.adoc')
-rw-r--r-- | doc/colm/2_02_list_map_struct_alias.adoc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/colm/2_02_list_map_struct_alias.adoc b/doc/colm/2_02_list_map_struct_alias.adoc new file mode 100644 index 00000000..adaccc7f --- /dev/null +++ b/doc/colm/2_02_list_map_struct_alias.adoc @@ -0,0 +1,23 @@ +List, Map, Struct and alias +=========================== + +Next to the basic types, there are the normal things that we can expect from scripting languages. +As colm is static and strong typed, it is very convienient to use alias as well. + +An example is probably much clearer then 1000 loc. + +[source,chapel] +.poker.md +---- +include::code/poker.lm[] +---- + +When we run this we get: + +---- +ok john 18 + + spades King +---- + +NOTE: this also illustrates how to iterate through a 'list' and access elements in a 'map'. |