concept seqs in category clojure

appears as: seqs, seqs
The Joy of Clojure, Second Edition

This is an excerpt from Manning's book The Joy of Clojure, Second Edition.

Listing 12.14. java.util.List conformance for sequences and seqs
(.get '[a b c] 1) #1 ;=> b (.get (repeat :a) 138)  #2 ;=> :a (.containsAll '[a b c] '[b c]) #3 ;=> true (.add '[a b c] 'd) #4 ; java.lang.UnsupportedOperationException #1 - Vectors #2 - Lazy seqs #3 - Vectors are collections #4 - Sequences aren’t mutable !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[]"} !@%STYLE%@!

Although basically the same shape as satisfy1, the new function satisfy has two additions that extend it. First, because the definition is recursive, you can no longer assume knowledge is given. Because the default case returns nil, you can use that fact as the terminating condition for failure . But this is a minor change compared to the recursive calls themselves. The point is easy to elucidate: when both terms are seqs, you want to attempt to satisfy them as deeply as they go . This is accomplished by building the knowledge of the first elements in each seq and using that as a seed for then satisfying the rest of the seqs . This is where the advantage of adding to the knowledge comes in handy: satisfy uses knowledge it learned earlier to resolve bindings later in the process. Observe the following: