Hi James,

  I'm new to clojure and maybe for this reason it's possible to put some 
'stupid' questions,  I came for Java so for me it's normal when I call a 
fc/method to execute the body of that fc/method and return a result; this 
is the reason for why I expect a result when I call (test-fc (range 
210432423543654675765876879)), I'm totally agree with you that this will 
take a long time to complete. I try to understand exactly how work 
internally lazy seq and for that I start to wrote this function to know how 
recursive call of function from inside of his body is replaced with plain 
recursion and in this way is avoided Stackoverflow ex..  

It's something wrong on my logic ?
Thanks
Sorin
 

On Monday, April 7, 2014 11:13:51 PM UTC+3, James Reeves wrote:
>
> Why do you expect (test-fc (range 210432423543654675765876879)) to return 
> a result?
>
> Even if each iteration of the loop takes only 1 nanosecond, your function 
> would take 6 billion years to complete.
>
> - James
>
>
> On 7 April 2014 21:01, sorin cristea <srncr...@gmail.com <javascript:>>wrote:
>
>>
>> Hi Gianluca, 
>>
>>  I have a question ; why when a run/execute command/code line (test-fc 
>> (range 210432423543654675765876879)) it's not executed the function 
>> test-fc and return the sum for all 210432423543654675765876879 elements? 
>> why should I put the test-fc reference to a variable, x, like you present 
>> below. ( this is related to your phrase - "your function computes a 
>> sequence of just one element (the sum of the collection members" - why ?)
>>
>>
>>  In this case (def x (test-fc (range 210432423543654675765876879)) I see 
>> here a problem, I keep a reference to the head of sequence and this will 
>> imply that the GC will can't garbage the unused items, if is wrong what I'm 
>> say please correct me. 
>>
>>  thanks a lot
>>  Sorin.
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com<javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> 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+u...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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