Skip to content

Instantly share code, notes, and snippets.

@stuarthalloway
Created May 2, 2010 19:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuarthalloway/387372 to your computer and use it in GitHub Desktop.
Save stuarthalloway/387372 to your computer and use it in GitHub Desktop.
; response to http://toinfinity.wordpress.com/2010/05/01/does-groovy-know-you-are-seeing-clojure
; tell the gnomes! phase two is (map - closing-prices)!
; prior to 1.2, reductions is in clojure.contrib.seq-utils
(->> (reductions min closing-prices) ;; lowest prices at each point
(map - closing-prices) ;; possible profit at each point
(apply max)) ;; profit!
@gdjsky01
Copy link

gdjsky01 commented May 2, 2010

Thank you. I will examine. I was using 1.1.0.

@choas
Copy link

choas commented May 2, 2010

@ clojure.core ->> has the note {:added "1.1"}

@stuarthalloway
Copy link
Author

choas: you'd think I'd know that given that I committed that note. :-) Good catch, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment