dmd 1.057 and 2.041 release

Steven Schveighoffer schveiguy at yahoo.com
Tue Mar 9 04:00:04 PST 2010


On Tue, 09 Mar 2010 03:09:51 -0500, Alexander Suhoverhov  
<alexander at suhoverhov.selfip.net> wrote:

>
>
> Steven Schveighoffer  at "Mon, 08 Mar 2010 15:23:51 -0500" wrote:
>  SS> On Mon, 08 Mar 2010 15:12:24 -0500, bearophile  
> <bearophileHUGS at lycos.com> wrote:
>  >> Steven Schveighoffer:
>  >>> 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]]
>  >>
>  >> You are missing something:
>  >>
>  >> ["hello world", ["how are", "you"]]
>  SS> For completely unambiguous, yes.  But still, I find often that  
> quotes are more noise than
>  SS> they are worth when just doing simple printouts.  What we  want is  
> the most useful
>  SS> default.
>
> Commas are even more noise than than quotes. erlang:
>
> [{app, "app1"}, {user, "user1"}, {score, 123456}, {date, 5000000},  
> {misc, "foo"}]
>
> But if you just drop commas:
>
> [{app "app1"} {user "user1"} {score 123456} {date 5000000} {misc "foo"}]

If you are used to writing code, you should be used to having commas.  The  
two major use cases for 'to!string' are debugging and maybe serialization,  
both programmer tasks.  Plus, in your examples, you have quotes for  
strings.  That negates the need for commas, but I don't know if having  
'to' convert strings to having quotes only for arrays makes sense.   
Outputting an array should be a recursive thing.  At the very least, we  
need either a non-whitespace separator or quotes to delineate strings.   
Brackets are a must to see the separation for multi-dimensional arrays.

-Steve


More information about the Digitalmars-d-announce mailing list