Common Lisp Package: COM.CLEARLY-USEFUL.INDEXABLE-PROTOCOL

Interface to the indexable protocol

README:

FUNCTION

Public

COLLECTION-P (OBJECT)

test if object implements COLLECTION

COUNTABLE-P (OBJECT)

test if object implements COUNTABLE

INDEXABLE-P (OBJECT)

test if object implements INDEXABLE

MACRO

Public

DOINDEXABLE ((VAR FORM &OPTIONAL RETURN-CLAUSE) &BODY BODY)

bind var to each item in (element-at indexed n) and execute body. where n is 0..(count-elements indexed) and indexed is (indexable form) similar to dolist.

GENERIC-FUNCTION

Public

COUNT-ELEMENTS (O)

the number of elements in o

COUNTABLE (OBJECT)

convert an object to COUNTABLE protocol, or error.

COUNTED-P (O)

whether a collection is counted in constant time

ELEMENT-AT (O INDEX)

the element of o at index, or raise an error

EMPTY (O)

an empty version of this collection

EMPTY-P (O)

wether this collection is empty

INDEXABLE (OBJECT)

convert an object to INDEXABLE protocol, or error.