Steven Schveighoffer, el 8 de marzo a las 14:57 me escribiste: > Tell me how you would parse the following text serialization string > for a string[]: > > hello world how are you > > What if it was a string[][]? > > Compare that to: > > [hello world, [how are, you]]
What about [1, 2]? > That is almost completely unambiguous (you still have to account for > literal commas or brackets), whereas you have a multitude of choices > with the first version. It's not too hard to be completely unambiguous. Just print the stuff in a way that is parseable for D: ["hello \"world\"", "nice \\"] [1, 2, 3] [1.0, 2.0, 3.0] Thiis is good for both serialization and debugging (it' unambiguous, mandatory for serialization, and a littl verbose but clear for debugging). And if sometime in the future we get a D parser in the stdlib, deserialization is trivial =). -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ----------------------------------------------------------------------
