I've been really bad about maintaining Data::JavaScript, so if anybody is interested in getting contributor maintenance rights for CPAN let me know, preferably with a respectable sample patch*.
Here are some of the things on the TO DO list:
#AB's code output
var facts = new Object;
facts.string = 'Joseph';
facts.xor = new Array;
facts.xor[0] = new Array;
facts.xor[0][0] = 0;
facts.xor[0][1] = 1;
facts.xor[1] = new Array;
facts.xor[1][0] = 1;
facts.xor[1][1] = 0;
…
#vs. SW output
var facts = new Array(new function() {
this.string = 'Joseph';
this.xor = new Array(new Array(0,1),new Array(1,0));
…
}
*The patch could be for (part of) something on the TO DO list, or anything else appropriate.
[]
resp. {}
. On the contrary: will produce an array of 3 null items, whilenew Array(3)
will produce an array of 2 items: the values 3 and 4.new Array(3, 4)
Re:new Array/new Object
belg4mit on 2007-03-24T22:26:05
Because
a) This is very old code, and we try to support older JavaScript versions (though there is no reason why, when you you tell the module you want v1.4 that it shouldn't use the slimmer syntax)
b) I'm not the original author. I wrote LiteObject and said I'd maintain this when Ariel passed away.
c) See the points already made in the original post (less verbose format, JSON-like format)
So the real question is, if it offends you so, are you going to submit a patch to gain commit rights?:-P Re:new Array/new Object
bart on 2007-03-24T23:07:32
Well, uh... If only I understood what the purpose behind it all is. I don't.Re:new Array/new Object
belg4mit on 2007-03-24T23:17:58
Data dumping to JavaScript. Be it for use with AJAX, or any other client-side data exporting purposes. It predates JSON and affords more flexibility. For instance, LiteObject is pretty efficient (nearly as small as literals but pre-JS1.2 compatible) and a good idiom for certain kinds of data.Re:new Array/new Object
bart on 2007-04-01T11:10:29
Is there any particular reason why you want to keep this alive, or is it largely obsolete?Re:new Array/new Object
belg4mit on 2007-04-01T15:12:56
I'm sorry, this is a non-sensical question: the second part does not follow from the first, and I've already made the case for maintaining it.