[nem-en] [RFC] type parens

Daniel James daniel at calamity.org.uk
Fri Sep 24 15:47:21 CEST 2004


Michal Moskal wrote:

>We don't feel very good about it -- it will break backward as well as
>C# compatibility, but this seems the only right thing to do. We already
>changed this once from the () parens, and converting the sources
>required lots of perl magic. We are going to provide similar perl magic
>with the 0.3 target release for this feature. It would work in most
>cases probably.

I think this is a really good idea. In case your interested, this issue
was recently discussed on the C++ newsgroups, some ideas for alternative
syntaxes were:

Hashtable!(int, string) - this is what the D programming language uses.
Hashtable.<int, string>
Hashtable<|int, string|>

And there were plenty of others along similar lines. I like the first
one, but I don't think it'd be right for your purposes since !( and .<
can already appear in Nemerle. Maybe something along the lines of:

Hashtable![int, string]

would be good, so it would be obvious that it isn't an array index. But,
if you don't like this, I think plain square brackets are fine.

Also, on a historical note, it turns out that there was some opposition 
to the syntax in 1992. And hindsight suggests that it was a mistake for 
the C++ standars committee to ignore it. For details see:

http://groups.google.com/groups?selm=chkira%24peq%241%40news1nwk.SFbay.Sun.COM

Daniel




More information about the devel-en mailing list