# Lazy Sequences

Sequences are an interface for logical lists, which can be lazy. "Lazy" means that a sequence can define an infinite series, like so:

``````(range 4)
``````

If you evaluate `(range)` just by itself it will return an infinite number of integers, well at least until your computers memory space fills up.

So we dont blow up our memory and just get the values we want we can use `range` in conjunction with other functions that define how many numbers we actually want.

For example, if we just wanted the first four numbers from the infinite sequence of `range` we could specify that with the `take` function

``````(take 4 (range)) ;  (0 1 2 3)
``````

Here the range function is being lazy, because it will only generate the first 4 numbers in its sequence.

Clojure (and Lisps in general) often evaluate at the last possible moment, usually when they have been given more specific content.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8748972,"math_prob":0.9476379,"size":866,"snap":"2021-21-2021-25","text_gpt3_token_len":194,"char_repetition_ratio":0.112529,"word_repetition_ratio":0.0,"special_character_ratio":0.21709007,"punctuation_ratio":0.077844314,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95074135,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-12T14:14:05Z\",\"WARC-Record-ID\":\"<urn:uuid:68036a42-9c84-49d2-b9b1-466af908aee9>\",\"Content-Length\":\"122752\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d16f781c-389e-4442-9508-0301063dabe0>\",\"WARC-Concurrent-To\":\"<urn:uuid:75597885-dd84-4ee5-8109-6fae6d57e356>\",\"WARC-IP-Address\":\"185.199.108.153\",\"WARC-Target-URI\":\"https://practicalli.github.io/clojure/using-data-structures/lazy-sequences.html\",\"WARC-Payload-Digest\":\"sha1:DU7ZYCWWDVDUSBLSLVS2H7PDM4O4B5VX\",\"WARC-Block-Digest\":\"sha1:KICCT47QMV2H44ZTWBZBXIQKLANP4OBA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243990929.24_warc_CC-MAIN-20210512131604-20210512161604-00246.warc.gz\"}"}