The following section details the commands that perform common operations on each type of list. Refer to prior tables for functions common to all lists, such as
You may need to determine a list’s type to decide which commands to use with it. You can use
listP() to determine whether a datum is any of the four possible types of lists, and you can use
ilk() for more detailed information about a list’s type. You can use
if...then statements and
case statements (see Chapter 5 for a comparison between
listP()). Two forms of the
ilk() command are used with lists:
This form of
ilk() returns a symbol indicating the data type of the item, such as
#point for the four list types. Note that linear lists return
#linearList. There are dozens of possible return values when using
ilk() with other data types, such as
#float. See Table 5-4.
This form of
ilk() returns a Boolean indicating whether the item is of the specified data type. Note that
, #list) returns TRUE for all types of lists and is equivalent to
, #linearList) to check only whether a list is a linear list. There are many symbols against which you can check an item’s data type, as shown in Table 16-1.
With the exception of
#linearList, note that these two forms of
ilk() are equivalent when used with ...