Hi Stéphane Goran writes here http://goran.krampe.se/2012/05/08/literal-arrays-vs-json-vs-ston-vs-tirade/ <citation> Literal Smalltalk arrays The simplest notation of all in the lineup is the literal array syntax in Smalltalk. The example below covers all its capabilities AFAIK (in Pharo/Squeak), please tell me if I missed anything: #(4711 3.4 16r3F 'string' #symbol #'another-symbol' (nested array) #(one more) true false nil $x #[12 32]) </citation> Do you agree that this covers everything in terms of literal arrays? --Hannes On 4/24/12, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Mariano
read the metacello mailing list mails I sent. I hate hate hate repeating myself.
I started to work on the LIteralArrayParser so that we do not have the problem in the future.
Stef
On Apr 24, 2012, at 12:52 PM, Mariano Martinez Peck wrote:
On Tue, Apr 24, 2012 at 12:43 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi guys
We should develop a simple Literal Array parser that is dialect independant so that we can avoid using JSON for meta data. So I will start to develop. I will start to write some tests and do it test first.
Gofer new repository: 'http://ss3.gemstone.com/ss/SimpleLiteralArrayParser'; package: 'SimpleLiteralArrayParser'; load
Now I still wonder what do we do about floats. May be the situation changed but Squeak and VW floats were not the same.
I don't get it. You define your own float format, and then each dialect parses it and converts it to their correspondant format... Now, I do not know the format differences so I do not know which one take :).
It can work for simple scenario but if you save a float with e120 and save it and you get e70 then you are in trouble.
You are not in trouble. And if you are, then you are exactlty the same as if you were using a literal parser. You have a specification. You say that floats are written in THIS XXX text representation. Nobody cares how your floats are represented inside your Smalltalk. For JSON you write floats in a particular way, explained by the JSON specification. Then, when you code the parser, you will need to crate an instance of Float from the string. Each dialect will know how to do that. So, again, where is the problem? And how the literal parser would solve it? because I think it will happen the same.
Cheers,
Stef
-- Mariano http://marianopeck.wordpress.com