O'Reilly logo

Clojure for Finance by Timothy Washington

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic data structures

Okay! Now we need to assign each price to a point in time in order to produce a time series. Let's think about what this data structure might look like. Assigning the price and time together might look something like '((t1 29.60706184716407) (t2 12.507593971664075)). But, this is not quite right. If you recall, evaluating (t1 29.60706184716407) would be how we invoke a function. If t1 is not a function, then your Clojure REPL will produce an error. Also, t1 and t2 denote points in time, but Clojure treats them as symbols—which have not been created yet. This will also produce an error. We could delay evaluation by quoting the '((t1 29.60706184716407) (t2 12.507593971664075) form). However, we'll still need to create the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required