There's another subtle notion to grasp when we talk about infinite lazy sequences. If we normally assign (or bind, in this case) some list or collection, we expect those artifacts to have values right away. You may have noticed that even after binding
timeseries, nothing happened. This is to say that binding these two Vars didn't immediately compute any values from the aforementioned expressions. This is the main feature that laziness provides. Only when we needed to pull out values using, for example,
(take 40 (generate-prices 5 15)) or
(take 2 our-average), were the expressions actually run. This means that
(def timeseries (generate-timeseries pricelist) bound a lazy sequence to the
timeseries symbol. ...