Maybe you want to try (nil (range 1 1000000)) and see if the problem is
there.
Am 10.02.2017 14:24 schrieb "Joh-Tob Schäg" <johtob...@gmail.com>:

> I had a similar experience. It tends to happen if you allocate to much at
> once. Should be around 16 Megabyte in this case which normally is no
> problem.
>
> If you have such a long list and want to apply functions to it I would use
> generators instead.
> They are less ram intensive.
>
> You do things wrong.
> For example you still forget to close you parathesis. This will leave us
> in a unresolved tension all day. Obligatory XKCD: https://xkcd.com/859/
> Am 10.02.2017 14:15 schrieb "Christopher Howard" <
> christopher.how...@qlfiles.net>:
>
>> Hi list. When I try to do
>>
>> (apply '+ (range 1 1000000)
>>
>> I get segfault. I thought maybe this was some kind of internal
>> limitation of the apply function, so I defined a foldl:
>>
>> (de foldl (Fn Acc Lst)
>>     (if (== () Lst) Acc
>>         (let Acc2 (Fn Acc (car Lst))
>>              (foldl Fn Acc2 (cdr Lst)) ) ) )
>>
>> : (foldl '+ 0 (range 1 1000))
>> (foldl '+ 0 (range 1 1000))
>> -> 500500
>> : (foldl '+ 0 (range 1 1000000))
>> (foldl '+ 0 (range 1 1000000))
>>
>> ..and again, a segfault.
>>
>> Am I doing something wrong?
>>
>> --
>> https://qlfiles.net
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>

Reply via email to