Re: efficiently building a large list

2012-06-01 Thread Tomas Hlavaty
Hi Joe, (de Load () (zero N) (setq L (make ( (in invoices.txt (until (eof) (setq Line (line) ) (setq D (mapcar pack (split Line ^I))) (link (new '(+Invoice) 'CustNum (car (nth D 1)) 'ProdNum (car (nth D 2)) 'Amount (format

Re: efficiently building a large list

2012-06-01 Thread Alexander Burger
On Thu, May 31, 2012 at 01:38:41PM -0400, Joe Bogner wrote: Calculating a SUM is very quick.. ! (bench (let Amt 0 (mapc '((This) (inc 'Amt (: Amount))) List))) 1.152 sec Minor optimization: You could also use 'sum' for that: (sum '((This) (: Amount)) List) Sidebar: Is there a way to

Re: efficiently building a large list

2012-06-01 Thread Alexander Burger
Hi Joe, This is what I came up with to aggregate the data. It actually runs reasonably well. I'm sharing because I always enjoy reading other people's picoLisp code so I figure others may as well. Yes, thanks! I can't delve into the code's logic at the moment, so just let me make some

Re: Parallel command execution

2012-06-01 Thread Jorge Acereda
Hi again, On May 29, 2012, at 4:40 PM, Alexander Burger wrote: Another option to avoid the fork() would be to have a pool of pre-forked instances reading from a jobs queue or something like that (perhaps taking advantage of an additional database to implement the queue?), but my skills

Re: Parallel command execution

2012-06-01 Thread Henrik Sarvell
I don't know if the boss function might be of help to you? It helped me in order for the current forked instance of the web server to be able to call the main process and do various slow writes there. The reason was that the user should not have to wait for stuff like that., ie the current child