9 lines
934 B
Plaintext
9 lines
934 B
Plaintext
# 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)
|