Node: Sequences, Next: , Previous: Characters, Up: Top



Sequences

All Common Lisp functions that operate on sequences operate on either lists or vectors. Strings are currently the only vectors in Lpp.

Many sequence functions take an optional test argument that is a predicate function of two arguments that tests for the action of the function to take place, otherwise eql is used. For example in

     remove(obj, sequence)
     remove(obj, sequence, test)
     

The first remove will remove the elements of sequence that are eql to the object obj. But in the second remove where the function object test is given then that is used for the comparison instead of eql. The rule here is that where the test function object is of the form

     test(obj, el)
     

The single object obj to compare is passed as the first argument and the second argument el being an element of the sequence to compare to is passed as the second argument. This ordering is important, for example if the test function was lessThan or a test function that compares two different object types by analyzing their components.