Skip to content

ListQ

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

ListQ[expr] gives True if expr is a list (head List), False otherwise.

Examples (2)

Every input below was run against the current Mathilda build and its output recorded.

Applications (2)

In[1]:= ListQ[{1, 2, 3}]
Out[1]= True

In[2]:= ListQ[5]
Out[2]= False

Implementation notes

builtin_listq (src/list.c) returns True/False according to the is_listq helper, i.e. whether the argument is an EXPR_FUNCTION whose head is the symbol List.

Attributes: Protected.

References

See also: VectorQ, MatrixQ, List

Notes & additional examples

Notes

ListQ tests only whether the head is List; it does not inspect the elements.