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