Clojure for Java Developers by Diaz Eduardo

Clojure for Java Developers by Diaz Eduardo

Author:Diaz, Eduardo [Diaz, Eduardo]
Language: eng
Format: azw3, epub, pdf
Publisher: Packt Publishing
Published: 2016-02-23T05:00:00+00:00


The sequence abstraction

Clojure has some unique features that make it different from other Lisps; one of them is the sequence abstraction. You can think of it as an interface that collections comply with. Clojure has a standard API of functions that you can use with sequences. Here are some examples of those functions:

The distinct function: This function returns a sequence that includes each element of the original sequence just once:(def c [1 1 2 2 3 3 4 4 1 1]) (distinct c) ;; (1 2 3 4)

The take function: This function takes a number of elements from the original sequence:(take 5 c) ;; (1 1 2 2 3)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.