Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-03-06 Thread Andy Wingo
On Mon 06 Mar 2017 14:50, Thien-Thi Nguyen writes: > FWIW, we can also use SRFI 13 to save a few cycles: > > (use-modules (ice-9 rdelim) (srfi srfi-13)) > > (define (file->lines filename) >"Return a list of lines contained in a file." >(call-with-input-file >filename > (l

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-03-06 Thread Thien-Thi Nguyen
() l...@gnu.org (Ludovic Courtès) () Sat, 11 Feb 2017 15:12:00 +0100 > (define (file->lines filename) > "Returns a list of lines contained in a file" > (call-with-input-file > filename > (lambda (p) > (let loop ([line (read-line p)]) > (if (eof-obj

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-02-11 Thread Ludovic Courtès
Hello! Sorry for the late reply. Germán Diago skribis: > (define (file->lines filename) > "Returns a list of lines contained in a file" > (call-with-input-file > filename > (lambda (p) > (let loop ([line (read-line p)]) > (if (eof-object? line) (list) > (

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-02-02 Thread Germán Diago
El El jue, 2 feb 2017 a las 5:24, Arne Babenhauserheide escribió: > > Germán Diago writes: > > >> Aside from using a more recent Guile, I do not see obvious > >> optimizations, however (more exactly: all my tries to speedup the code > >> only made it slower). > > > > I was struggling with using

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-02-01 Thread Arne Babenhauserheide
Germán Diago writes: >> Aside from using a more recent Guile, I do not see obvious >> optimizations, however (more exactly: all my tries to speedup the code >> only made it slower). > > I was struggling with using read-line! instead of read-line but > experimenting in the command line > I cannot

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-01-31 Thread Germán Diago
> > If I understand your script correctly, you want to grab all lines with > GDP, sort the values by year and country and output them. Is that right? > > As a first warning: the csv module in Python mainly calls into a C-based > implementation (_csv, see csv.__file__), so it will be hard to beat th

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-01-31 Thread Arne Babenhauserheide
Hi Germán, If I understand your script correctly, you want to grab all lines with GDP, sort the values by year and country and output them. Is that right? As a first warning: the csv module in Python mainly calls into a C-based implementation (_csv, see csv.__file__), so it will be hard to beat

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-01-30 Thread Alex Vong
Hello, Germán Diago writes: > Hello everyone, > > I did a script that parses some file with the GDP since 1970 for many > countries. I filter the file and discard uninteresting fields, later I > write in a format suitable for gnuplot. > Wow, you started programming before I was born! > I did t