Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Collections/Icon/collections-1.icon
Normal file
8
Task/Collections/Icon/collections-1.icon
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Creation of collections:
|
||||
s := "abccd" # string, an ordered collection of characters, immutable
|
||||
c := 'abcd' # cset, an unordered collection of characters, immutable
|
||||
S := set() # set, an unordered collection of unique values, mutable, contents may be of any type
|
||||
T := table() # table, an associative array of values accessed via unordered keys, mutable, contents may be of any type
|
||||
L := [] # list, an ordered collection of values indexed by position 1..n or as stack/queue, mutable, contents may be of any type
|
||||
record constructorname(field1,field2,fieldetc) # record, a collection of values stored in named fields, mutable, contents may be of any type (declare outside procedures)
|
||||
R := constructorname() # record (creation)
|
||||
6
Task/Collections/Icon/collections-2.icon
Normal file
6
Task/Collections/Icon/collections-2.icon
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
s ||:= "xyz" # concatenation
|
||||
c ++:= 'xyz' # union
|
||||
insert(S,"abc") # insert
|
||||
T["abc"] := "xyz" # insert create/overwrite
|
||||
put(L,1) # put (extend), also push
|
||||
R.field1 := "xyz" # overwrite
|
||||
4
Task/Collections/Icon/collections-3.icon
Normal file
4
Task/Collections/Icon/collections-3.icon
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
S := S ++ S2 # union of two sets or two csets
|
||||
S ++:= S2 # augmented assignment
|
||||
L := L ||| L2 # list concatenation
|
||||
L |||:= L2 # augmented assignment
|
||||
Loading…
Add table
Add a link
Reference in a new issue