Language Guide

CHAPTER 3
Values
Value Class Denitions 51
COMMANDS HANDLED
You can count the items in a list with the Count command. For example, the
value of the following statement is 6.
count {"a", "b", "c", 1, 2, 3}
--result: 6
You can also count elements of a specific class in a list. For example, the value
of the following statement is 3.
count integers in {"a", "b", "c", 1, 2, 3}
--result: 3
Another way to count the items in a list is with a Length property reference:
length of {"a", "b", "c", 1, 2, 3}
--result: 6
REFERENCE FORMS
Use the following reference forms to refer to properties of lists and items in lists:
Property. For example, class of {"this", "is", "a", "list"}
specifies list.
Index. For example, item 3 of {"this", "is", "a", "list"}
specifies "a".
Middle. For example, middle item of {"this", "is", "a",
"list"} specifies "is".
Arbitrary. For example, some item of {"soup", 2, "nuts"} might
specify any of the items in the list.
Every Element. For example, every item of {"soup", 2, "nuts"}
specifies {"soup", 2, "nuts"}.
Range. For example, items 2 thru 3 of {"soup", 2, "nuts"}
specifies {2, "nuts"}.