Re: Segfault with huge list...?

2017-02-10 Thread Lindsay John Lawrence
I think I'll start keeping a list =) of picolisp's pleasant surprises. /Lindsay On Fri, Feb 10, 2017 at 11:06 AM, Joh-Tob Schäg wrote: > Linsday when you want to prevent values from neing printed take a look at > the 'nil function. > >

Re: Segfault with huge list...?

2017-02-10 Thread Joh-Tob Schäg
Linsday when you want to prevent values from neing printed take a look at the 'nil function. Am 10.02.2017 19:44 schrieb "Lindsay John Lawrence" < lawrence.lindsayj...@gmail.com>: > If it even matters, the overhead of recurse is slowest here. > So impressive that picolisp can iterate/recurse over

Re: Segfault with huge list...?

2017-02-10 Thread Lindsay John Lawrence
If it even matters, the overhead of recurse is slowest here. So impressive that picolisp can iterate/recurse over a 10M element list in these times. (VirtualBox VM, 4GB, 1Core, with 64bit Debian). .. and 'make' is a lot more useful that I first realized. /Lindsay # Iterative (de sumi (L) (let

Re: Segfault with huge list...?

2017-02-10 Thread Mike Pechkin
yea On Fri, Feb 10, 2017 at 5:21 PM, Joh-Tob Schäg wrote: > (de natsum (N) > (if (=0 N) > 0 > ( + N > ( natsum ( dec N) > > Like that? > Am 10.02.2017 15:28 schrieb "Mike Pechkin" : > >> hi, >> >> On Fri, Feb 10, 2017 at 3:07 PM, Christopher Howard < >> christopher.how..

Re: Segfault with huge list...?

2017-02-10 Thread Joh-Tob Schäg
(de natsum (N) (if (=0 N) 0 ( + N ( natsum ( dec N) Like that? Am 10.02.2017 15:28 schrieb "Mike Pechkin" : > hi, > > On Fri, Feb 10, 2017 at 3:07 PM, Christopher Howard < > christopher.how...@qlfiles.net> wrote: > > > Hi list. When I try to do > > > > (apply '+ (range 1

Re: Segfault with huge list...?

2017-02-10 Thread Mike Pechkin
hi, On Fri, Feb 10, 2017 at 3:07 PM, Christopher Howard < christopher.how...@qlfiles.net> wrote: > Hi list. When I try to do > > (apply '+ (range 1 100) > ​List of ​millions of items is not a problem. Problem how you use it. (apply) is not for free, ​It *creates*​ a function call with a mil

Re: Segfault with huge list...?

2017-02-10 Thread Joh-Tob Schäg
That sounds very plausible. Am 10.02.2017 14:35 schrieb "Joe Bogner" : > It sounds like it's exceeding the stack size. Have you tried setting it to > unlimited? ulimit -s unlimited > > http://www.mail-archive.com/picolisp@software-lab.de/msg01203.html > > On Fri, Feb 10, 2017 at 8:07 AM, Christoph

Re: Segfault with huge list...?

2017-02-10 Thread Joe Bogner
It sounds like it's exceeding the stack size. Have you tried setting it to unlimited? ulimit -s unlimited http://www.mail-archive.com/picolisp@software-lab.de/msg01203.html On Fri, Feb 10, 2017 at 8:07 AM, Christopher Howard < christopher.how...@qlfiles.net> wrote: > Hi list. When I try to do >

Re: Segfault with huge list...?

2017-02-10 Thread Joh-Tob Schäg
Maybe you want to try (nil (range 1 100)) and see if the problem is there. Am 10.02.2017 14:24 schrieb "Joh-Tob Schäg" : > 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

Re: Segfault with huge list...?

2017-02-10 Thread Joh-Tob Schäg
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.

Segfault with huge list...?

2017-02-10 Thread Christopher Howard
Hi list. When I try to do (apply '+ (range 1 100) 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))