Re: D-styled data file

2009-04-30 Thread Saaa
> If your licensing requirements allow Commercial use should allow this I think. >, you can probably just extract tango.text.json and use that -- it >shouldn't have significant requirements on the rest of tango. These are the dependencies: module tango.text.json.Json; private import tango.core

Re: D-styled data file

2009-04-30 Thread Saaa
Can somebody help me out here? > This is what I came up with to save a multidimentional array in JSON. > It compiles . . but does not work : ) > > > int[100][100][10] bigArray; > > //set the array to something other then zero > foreach( int[100][100] arr; bigArray) > foreach(int index, int[100]

Re: D-styled data file

2009-04-29 Thread Christopher Wright
Saaa wrote: "Christopher Wright" wrote in message news:gtb02h$e4...@digitalmars.com... Saaa wrote: If the JSON writer won't write every item (which will be thousands of items) on a new line and reading in multi arrays, then I think I need to witch to Tango :D Tango's JSON printer has options

Re: D-styled data file

2009-04-29 Thread Saaa
"Christopher Wright" wrote in message news:gtb02h$e4...@digitalmars.com... > Saaa wrote: >> If the JSON writer won't write every item (which will be thousands of >> items) >> on a new line and reading in multi arrays, then I think I need to witch >> to Tango :D > > Tango's JSON printer has opt

Re: D-styled data file

2009-04-29 Thread Saaa
This is what I came up with to save a multidimentional array in JSON. It compiles . . but does not work : ) int[100][100][10] bigArray; //set the array to something other then zero foreach( int[100][100] arr; bigArray) foreach(int index, int[100] miniarr; arr) miniarr[] = index; auto json

Re: D-styled data file

2009-04-29 Thread Christopher Wright
Saaa wrote: If the JSON writer won't write every item (which will be thousands of items) on a new line and reading in multi arrays, then I think I need to witch to Tango :D Tango's JSON printer has options for pretty-printing and condensed printing. The default is condensed; everything will

Re: D-styled data file

2009-04-29 Thread Saaa
> Well, then were really talking about Classic Serialzation. In other > words, a program writes data somewhere (possibly in human readable > format), and then later (as in tomorrow) reads it in. Ok, lets start from there :D > >>> Now, to know how to use the stuff, the program would need to not o

Re: D-styled data file

2009-04-29 Thread Georg Wrede
Saaa wrote: Simply put, I'd like a D styled dataformat alike JSON. Somehow saying that I would like it D styled makes it difficult to understand :) "Georg Wrede" wrote in message news:gta2r9$1vl...@digitalmars.com... Saaa wrote: I'm still dangling between a full parsing at load and parse o

Re: D-styled data file

2009-04-29 Thread Saaa
Simply put, I'd like a D styled dataformat alike JSON. Somehow saying that I would like it D styled makes it difficult to understand :) "Georg Wrede" wrote in message news:gta2r9$1vl...@digitalmars.com... > Saaa wrote: I'm still dangling between a full parsing at load and parse on demand.

Re: D-styled data file

2009-04-29 Thread Georg Wrede
Saaa wrote: I'm still dangling between a full parsing at load and parse on demand. A parse on demand (get) would do the following steps: Get the type of the variable in which the data must be stored (in string format) Search for this type in every line of the char[][], when found check whether

Re: D-styled data file

2009-04-29 Thread Saaa
"Lutger" wrote in message news:gt9rjm$1hp...@digitalmars.com... > Saaa wrote: > >> I would like to be able to read and write variables which are human >> readable. >> It should be as fast as possible and easy to use. >> > ... >> -- >> >> Any comments, questions or pointers? >> Maybe all this is

Re: D-styled data file

2009-04-29 Thread Lutger
Saaa wrote: > I would like to be able to read and write variables which are human > readable. > It should be as fast as possible and easy to use. > ... > -- > > Any comments, questions or pointers? > Maybe all this is already available? > I would think that the parsing code is already available

Re: D-styled data file

2009-04-29 Thread Saaa
>> I'm still dangling between a full parsing at load and parse on demand. >> A parse on demand (get) would do the following steps: >> Get the type of the variable in which the data must be stored (in string >> format) >> Search for this type in every line of the char[][], when found check >> wh

Re: D-styled data file

2009-04-29 Thread Georg Wrede
Saaa wrote: Thanks for your reply "Georg Wrede" wrote in message news:gt96lc$di...@digitalmars.com... Saaa wrote: I changed the prototype to: void get(in char[] varName, ...) I'm not totally happy with it because I only need one variadic argument and : How do I get the .stringof of an v

Re: D-styled data file

2009-04-29 Thread Saaa
Thanks for your reply "Georg Wrede" wrote in message news:gt96lc$di...@digitalmars.com... > Saaa wrote: >> I changed the prototype to: >> >> void get(in char[] varName, ...) >> >> I'm not totally happy with it because I only need one variadic argument >> and : >> >> How do I get the .stringof o

Re: D-styled data file

2009-04-29 Thread Georg Wrede
Saaa wrote: I changed the prototype to: void get(in char[] varName, ...) I'm not totally happy with it because I only need one variadic argument and : How do I get the .stringof of an variadic type? _arguments[0].stringof doesn't work :) How do I mutate the original argument? (ref) Please

Re: D-styled data file

2009-04-28 Thread Saaa
I changed the prototype to: void get(in char[] varName, ...) I'm not totally happy with it because I only need one variadic argument and : How do I get the .stringof of an variadic type? _arguments[0].stringof doesn't work :) How do I mutate the original argument? (ref) Please tell me if I'm

Re: D-styled data file

2009-04-27 Thread Saaa
Maybe add another keyword to force a full index parse :)

D-styled data file

2009-04-27 Thread Saaa
I would like to be able to read and write variables which are human readable. It should be as fast as possible and easy to use. Something like this: -- file.dat char[] header = `test header`; int[6] numbers = [ 1, 2, 3, 4, 5, 6]; // not sure about the array layout yet // the following layout m