|
count
|
The count function returns the number of values in the object argument {obj}.
If {obj} is a collection object, such as a List, Vector, Structure, Matirx, Dictionary, or
Directory, the count function performs a deep count, i.e., all items in
any imbedded collection objects are also counted. When to use Use the countfunction to determine the total number of items in an object,
including the items in imbedded collection objects. This type of counting is called a
deep count. An alternate type of counting is called a shallow count in which embedded
collection objects are counted as one. An alternate function, the length
function, performs a shallow count.
(count obj) If the target is #void, character, number, symbol, text, string, or Boolean,
the value 1 is returned.
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments. Here are also a number of links to functions having arguments with any of these data types.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types obj Any Analytic Information Server object Structure Integer Character Number Symbol Text String Boolean
List Pair Vector Dictionary Directory Matrix
Returns:
If the target is a List, then the number of Pairs in the list is returned.
If the target is a Vector, then the number of items in the vector is returned.
If the target is a Structure, Dictionary, or Directory, then the number of bindings is returned.
If the target is a Matrix, then the number of non-void items is returned.
Examples
Argument Types
Structure
Integer
Character
Number
Symbol
Text
String
BooleanNumMatrix
List
Pair
Vector
Dictionary
Directory
Matrix
How do I contact the AIS team?