Review of Jesse Phillips's CSV Parser

2011-10-28 Thread dsimcha
Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs: http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html Code:

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Piotr Szturmaj
dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs: http://nascent.freeshell.org/programming/D/doc/phobos/std_csv

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Vladimir Panteleev
On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: Docs: http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html Documentation should have examples of basic usage at the top. It should be possible to figure out how to use a CSV parser within 10 seconds of looking at the docs.

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread dsimcha
On 10/28/2011 9:18 AM, dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs: http://nascent.freeshell.org/programm

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jacob Carlborg
On 2011-10-28 15:25, Piotr Szturmaj wrote: dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs:

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jacob Carlborg
On 2011-10-28 15:18, dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs: http://nascent.freeshell.org/programming/

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Piotr Szturmaj
Jacob Carlborg wrote: On 2011-10-28 15:25, Piotr Szturmaj wrote: dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread.

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread deadalnix
Le 28/10/2011 16:09, Piotr Szturmaj a écrit : Jacob Carlborg wrote: On 2011-10-28 15:25, Piotr Szturmaj wrote: dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please pos

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Ary Manzana
On 10/28/11 10:18 AM, dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs: http://nascent.freeshell.org/programming/

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jesse Phillips
dsimcha Wrote: > I'll kick this off with my review of the documentation (I'll review the > implementation later): > > "Header may be provided as first line in file" -> "A header may be > provided as first line in file"? > > csvText: Shouldn't heading be a generic range of strings instead of a

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jesse Phillips
Piotr Szturmaj Wrote: > dsimcha wrote: > > Formal review of Jesse Phillips's CSV parser module begins today and > > runs through November . Following that, a vote will take place for one > > week. Please post any comments about this library in this thre

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jesse Phillips
Ary Manzana Wrote: > I like the idea of reading a CSV into a struct, or treating all fields > as ints. > > But, in my experience, CSVs are never perfect... because humans fill > them, and humans aren't perfect or don't know "Oh, of course I must fill > only numbers in this column, otherwise pr

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jesse Phillips
Vladimir Panteleev Wrote: > On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: > > > Docs: > > http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html > > Documentation should have examples of basic usage at the top. It should be > possible to figure out how to use a CSV parser wit

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jesse Phillips
Forgot to answer one. dsimcha Wrote: > Why should the order of the heading provided to csvText matter? csvText > should simply rearrange its results. Because I do not store anymore information then requested. I must keep pumping out values as I receive them, so order can not be rearranged. Wi

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Ary Manzana
On 10/28/11 1:14 PM, Jesse Phillips wrote: Ary Manzana Wrote: I like the idea of reading a CSV into a struct, or treating all fields as ints. But, in my experience, CSVs are never perfect... because humans fill them, and humans aren't perfect or don't know "Oh, of course I must fill only numbe

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jesse Phillips
Jacob Carlborg Wrote: > If a header is specified, is it possible to iterate over the content as > an associative array, something like this: > > string str = "a,b,c\nHello,65,63.63\nWorld,123,3673.562"; > auto records = csvText(str, ["b"]); > > foreach (header, value ; records) {} > > Or acces

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jesse Phillips
Ary Manzana Wrote: > You are right. > > I see that you throw ConvException, because when some to!... fails it > throws that. But you don't catch it. So you'd get something like "Can't > convert 'hello' to an int", but you loose the information of which row > and column caused the problem. So m

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Jacob Carlborg
On 2011-10-28 19:07, Jesse Phillips wrote: Jacob Carlborg Wrote: If a header is specified, is it possible to iterate over the content as an associative array, something like this: string str = "a,b,c\nHello,65,63.63\nWorld,123,3673.562"; auto records = csvText(str, ["b"]); foreach (header, va

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Vladimir Panteleev
On Fri, 28 Oct 2011 19:41:35 +0300, Jesse Phillips wrote: Vladimir Panteleev Wrote: On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: > Docs: > http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html Documentation should have examples of basic usage at the top. It should be

Re: Review of Jesse Phillips's CSV Parser

2011-10-28 Thread Walter Bright
On 10/28/2011 6:18 AM, dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs: http://nascent.freeshell.org/programm

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread bls
On 10/28/2011 12:18 PM, Walter Bright wrote: Formal review of Jesse Phillips's CSV parser module Walter, Asking for high precision documentation is fine. And since you face it ... What about having such a high precision for D2 language definition ? std.csv is pretty cool. No doubt

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread Jesse Phillips
8 AM, dsimcha wrote: >> Formal review of Jesse Phillips's CSV parser module begins today and >> runs through November . Following that, a vote will take place for one >> week. Please post any comments about this library in this thread. >> >> Docs: >>

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread Jesse Phillips
On Sat, 29 Oct 2011 15:27:22 -0700, bls wrote: > On 10/28/2011 12:18 PM, Walter Bright wrote: >> Formal review of Jesse Phillips's CSV parser module > > Walter, > Asking for high precision documentation is fine. > And since you face it ... > What about having

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread bls
On 10/29/2011 03:56 PM, Jesse Phillips wrote: std.csv is pretty cool. No doubt, But shouldn't std.csv be based on > std.lexer ? > > A+ Well, std.lexer doesn't exist. And if it is reasonable to use one, then it could be done without changing the API. I think the database API stuff will have mu

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread Jonathan M Davis
On Saturday, October 29, 2011 22:33:30 Jesse Phillips wrote: > > On 10/28/2011 6:18 AM, dsimcha wrote: > > First off, mucho thanks to Jesse for writing this. It's an important > > module for Phobos. > > Thank you. Fun fact, many popular languages don't include a CSV parser, > C# and Java being not

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread Walter Bright
On 10/29/2011 3:27 PM, bls wrote: What about having such a high precision for D2 language definition ? Specific suggestions are welcome. Patches are even more welcome. std.csv is pretty cool. No doubt, But shouldn't std.csv be based on std.lexer ? I don't see a similarity.

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread Walter Bright
On 10/29/2011 3:33 PM, Jesse Phillips wrote: "This parser will loosely follow the RFC-4180" How exactly will it differ from RFC-4180? I do not know how to address this. After making this statement I list the criteria. I don't see the need to list where it differs: * Records terminate with LF,

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread Jesse Phillips
On Sat, 29 Oct 2011 17:19:44 -0700, Jonathan M Davis wrote: > On Saturday, October 29, 2011 22:33:30 Jesse Phillips wrote: >> > On 10/28/2011 6:18 AM, dsimcha wrote: >> > First off, mucho thanks to Jesse for writing this. It's an important >> > module for Phobos. >> >> Thank you. Fun fact, many p

Re: Review of Jesse Phillips's CSV Parser

2011-10-29 Thread Jesse Phillips
On Sat, 29 Oct 2011 17:05:01 -0700, bls wrote: > Regarding std.database.. Please elaborate/ ATM I just can imagine that > std.csv will be used for Import/Export. CSV is tabular data, so it would make sense that you may have a similar interface as you would a database. csv.select("name").where!

Re: Review of Jesse Phillips's CSV Parser

2011-10-30 Thread Jesse Phillips
Thank you for the response, only one more follow-up question. Records Record Don't these look easy to confuse? And funny if we didn't have type inference. Records records = csvText(str); foreach(Record record; records) ... Anyone want to complain about this suggestion? Record is private and c

Re: Review of Jesse Phillips's CSV Parser

2011-10-30 Thread Steve Teale
On Sun, 30 Oct 2011 17:02:26 +, Jesse Phillips wrote: > Thank you for the response, only one more follow-up question. > > Records > Record If it's any consolation, I'm suffering from similar questions to myself in my naming of structs and methods for my database interface experiments. Sinc

Re: Review of Jesse Phillips's CSV Parser

2011-10-30 Thread Walter Bright
On 10/30/2011 10:02 AM, Jesse Phillips wrote: Thank you for the response, only one more follow-up question. Records Record Don't these look easy to confuse? And funny if we didn't have type inference. Records records = csvText(str); foreach(Record record; records) ... Anyone want to complain

Re: Review of Jesse Phillips's CSV Parser

2011-10-30 Thread Eric Poggel (JoeCoder)
On 10/29/2011 10:03 PM, Walter Bright wrote: I want to press Andrei to write up a doc on "What's a Range" As a D1 user planning to migrate, this would be very appreciated.

Re: Review of Jesse Phillips's CSV Parser

2011-10-31 Thread Vladimir Panteleev
On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: Docs: http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html Checked the new docs today. If I'm reading them right, the top example prints: "Fred works as a Fly and earns $4 per year" Is this a pop culture reference I'm not c

Re: Review of Jesse Phillips's CSV Parser

2011-10-31 Thread Jesse Phillips
On Mon, 31 Oct 2011 19:21:02 +0200, Vladimir Panteleev wrote: > On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: > >> Docs: >> http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html > > Checked the new docs today. If I'm reading them right, the top example > prints: > > "Fred wor

Re: Review of Jesse Phillips's CSV Parser

2011-10-31 Thread Jonathan M Davis
On Tuesday, November 01, 2011 01:28:07 Jesse Phillips wrote: > On Mon, 31 Oct 2011 19:21:02 +0200, Vladimir Panteleev wrote: > > On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: > >> Docs: > >> http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html > > > > Checked the new docs today

Re: Review of Jesse Phillips's CSV Parser

2011-11-02 Thread Jacob Carlborg
On 2011-11-01 02:28, Jesse Phillips wrote: On Mon, 31 Oct 2011 19:21:02 +0200, Vladimir Panteleev wrote: On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: Docs: http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html Checked the new docs today. If I'm reading them right, the to

Re: Review of Jesse Phillips's CSV Parser

2011-11-02 Thread Vladimir Panteleev
On Tue, 01 Nov 2011 03:28:07 +0200, Jesse Phillips wrote: On Mon, 31 Oct 2011 19:21:02 +0200, Vladimir Panteleev wrote: On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: Docs: http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html Checked the new docs today. If I'm reading

Re: Review of Jesse Phillips's CSV Parser

2011-11-02 Thread Jesse Phillips
On Wed, 02 Nov 2011 15:11:24 +0200, Vladimir Panteleev wrote: > I guess such things are really subjective, but personally to me it does > seem a bit silly, and out-of-place from the documentation of a language > that aims to be the successor of C++. I'll make it a pop culture reference... kidding

Re: Review of Jesse Phillips's CSV Parser

2011-11-05 Thread Somedude
Le 30/10/2011 03:09, Jesse Phillips a écrit : > That is all I meant by it. A CSV parser does exist for every language, > but none come packaged with the language. C# even chose not to include an > ini so people would use XML. It really is sad that instead of something > solid they go the way of

Re: Review of Jesse Phillips's CSV Parser

2011-11-05 Thread Jesse Phillips
On Fri, 28 Oct 2011 09:18:27 -0400, dsimcha wrote: > Formal review of Jesse Phillips's CSV parser module begins today and > runs through November . Following that, a vote will take place for one > week. Please post any comments about this library in this thread. &

Re: Review of Jesse Phillips's CSV Parser

2011-11-06 Thread Jesse Phillips
lips wrote: > On Fri, 28 Oct 2011 09:18:27 -0400, dsimcha wrote: > >> Formal review of Jesse Phillips's CSV parser module begins today and >> runs through November . Following that, a vote will take place for one >> week. Please post any comments about this libra

Re: Review of Jesse Phillips's CSV Parser

2011-11-06 Thread dsimcha
On 10/28/2011 9:18 AM, dsimcha wrote: Formal review of Jesse Phillips's CSV parser module begins today and runs through November . Following that, a vote will take place for one week. Please post any comments about this library in this thread. Docs: http://nascent.freeshell.org/programm

Re: Review of Jesse Phillips's CSV Parser

2011-11-06 Thread Jonathan M Davis
On Sunday, November 06, 2011 20:49:29 dsimcha wrote: > On 10/28/2011 9:18 AM, dsimcha wrote: > > Formal review of Jesse Phillips's CSV parser module begins today and > > runs through November . Following that, a vote will take place for one > > week. Please post any comm

Re: Review of Jesse Phillips's CSV Parser

2011-11-07 Thread Robert Jacques
On Sun, 06 Nov 2011 19:00:42 -0500, Jesse Phillips wrote: And only one pending request, csvFormatter. I am still considering how I want to approach this. I don't want to rush it in so I don't plan on having it complete before voting starts. My primary use of csv files is as a method of saving

Re: Review of Jesse Phillips's CSV Parser

2011-11-10 Thread Jonathan M Davis
On Friday, October 28, 2011 09:18:27 dsimcha wrote: > Formal review of Jesse Phillips's CSV parser module begins today and > runs through November . Following that, a vote will take place for one > week. Please post any comments about this library in this thread. >

Re: Review of Jesse Phillips's CSV Parser

2011-11-10 Thread Jesse Phillips
On Mon, 07 Nov 2011 23:28:20 -0500, Robert Jacques wrote: > On Sun, 06 Nov 2011 19:00:42 -0500, Jesse Phillips > wrote: >> And only one pending request, csvFormatter. I am still considering how >> I want to approach this. I don't want to rush it in so I don't plan on >> having it complete before

Re: Review of Jesse Phillips's CSV Parser

2011-11-10 Thread Jesse Phillips
Thank you, lots of stuff to ponder and comment. On Thu, 10 Nov 2011 02:10:28 -0800, Jonathan M Davis wrote: > On Friday, October 28, 2011 09:18:27 dsimcha wrote: >> Formal review of Jesse Phillips's CSV parser module begins today and >> runs through November . Following th

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Jonathan M Davis
On Friday, November 11, 2011 03:17:10 Jesse Phillips wrote: > > I also have some API design concerns. Primarily, most of the type names > > are overly broad and unclear. For example: Record, Records, Malformed > > could just as easily be part of a database API. And because of this, not > > only doe

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Don
On 02.11.2011 09:02, Jacob Carlborg wrote: On 2011-11-01 02:28, Jesse Phillips wrote: On Mon, 31 Oct 2011 19:21:02 +0200, Vladimir Panteleev wrote: On Fri, 28 Oct 2011 16:18:27 +0300, dsimcha wrote: Docs: http://nascent.freeshell.org/programming/D/doc/phobos/std_csv.html Checked the new do

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Jacob Carlborg
On 2011-11-11 12:50, Don wrote: Far more horrible than that -- in an old Excel from around 2000 the user interface used US settings for reading short dates, if the day of the month was 12 or less. Otherwise it uses the locale. But it always uses the locale for displaying them. So 11/1, 12/1, 13/

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Vladimir Panteleev
On Fri, 11 Nov 2011 13:50:52 +0200, Don wrote: Far more horrible than that -- in an old Excel from around 2000 the user interface used US settings for reading short dates, if the day of the month was 12 or less. Otherwise it uses the locale. But it always uses the locale for displaying the

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Jesse Phillips
On Fri, 11 Nov 2011 02:17:40 -0800, Jonathan M Davis wrote: > Actually, I'd argue that Row would be better than Record, since it _is_ > a row in a table. Personally, I'd find it to be more immediately clear > that way. With Record, I have to figure out what the heck it is a record > of, whereas Ro

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Jonathan M Davis
On Friday, November 11, 2011 15:25:29 Jesse Phillips wrote: > On Fri, 11 Nov 2011 02:17:40 -0800, Jonathan M Davis wrote: > > Actually, I'd argue that Row would be better than Record, since it _is_ > > a row in a table. Personally, I'd find it to be more immediately clear > > that way. With Record,

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Manu
On 11 November 2011 19:07, Jonathan M Davis wrote: > On Friday, November 11, 2011 15:25:29 Jesse Phillips wrote: > > On Fri, 11 Nov 2011 02:17:40 -0800, Jonathan M Davis wrote: > > > Actually, I'd argue that Row would be better than Record, since it _is_ > > > a row in a table. Personally, I'd fi

Re: Review of Jesse Phillips's CSV Parser

2011-11-11 Thread Robert Jacques
On Thu, 10 Nov 2011 22:17:10 -0500, Jesse Phillips wrote: On Mon, 07 Nov 2011 23:28:20 -0500, Robert Jacques wrote: On Sun, 06 Nov 2011 19:00:42 -0500, Jesse Phillips wrote: [snip] I also have some API design concerns. Primarily, most of the type names are overly broad and unclear. For exam

Re: Review of Jesse Phillips's CSV Parser

2011-11-15 Thread Jesse Phillips
On Sat, 12 Nov 2011 00:21:55 -0500, Robert Jacques wrote: > On Thu, 10 Nov 2011 22:17:10 -0500, Jesse Phillips > wrote: >> On Mon, 07 Nov 2011 23:28:20 -0500, Robert Jacques wrote: >>> On Sun, 06 Nov 2011 19:00:42 -0500, Jesse Phillips >>> wrote: > [snip] >>> I also have some API design concerns

Re: Review of Jesse Phillips's CSV Parser

2011-11-15 Thread Robert Jacques
On Tue, 15 Nov 2011 22:30:51 -0500, Jesse Phillips wrote: On Sat, 12 Nov 2011 00:21:55 -0500, Robert Jacques wrote: On Thu, 10 Nov 2011 22:17:10 -0500, Jesse Phillips wrote: On Mon, 07 Nov 2011 23:28:20 -0500, Robert Jacques wrote: On Sun, 06 Nov 2011 19:00:42 -0500, Jesse Phillips wrote:

Re: Review of Jesse Phillips's CSV Parser

2011-11-15 Thread Jesse Phillips
On Tue, 15 Nov 2011 23:12:57 -0500, Robert Jacques wrote: > Thank you for explaining. I wasn't seeing the implementation efficiency > that comes from the custom struct approach. No, thank you. It is good to have someone fighting a different opinion. It is because of you we can have this bike-she