Algorithm.single
Checks if there is exactly one element in an enumerable.
Arguments
The
enumerable
to check.
Return values
condition
is TRUE if there is one element, FALSE otherwise.
Complexity
Depends on the enumerable.
Example
"sl/algorithm" useFile
"sl/linkedList" useFile
a: (1) makeList;
a single print LF print
(2) single print LF print
a range single print
Output:
TRUE
TRUE
TRUE