On Monday, June 13, 2016 at 4:38:47 PM UTC-4, Gary Trakhman wrote:
>
> What's surprising about this?  Maybe you want the promoting *' variant:
>
> > (def expexp (lazy-cat [2] (map #(*' % %) expexp)))
> #'sandbox21201/expexp
> > (take 100 expexp)
> Execution Timed Out!
>
> Seems like it's a big number :-)
>

Since the number of digits is near-doubling each time, the final value 
would have nearly 2^100 ~ 10^31, over a nonillion. The memory requirements 
are easier still -- the first five iterates need a 32-bit word apiece, 
after that the number needed keeps doubling, to 2^96 for the last one. 
That's going to be about an octillion bytes. If it hadn't timed out it 
would have thrown OOME ... eventually.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to