de facto keywords

Robert Fraser fraserofthenight at gmail.com
Sat Apr 5 12:43:51 PDT 2008


Paul D. Anderson wrote:
> It seems to me there exist a few "unofficial" keywords in D that should be promoted to reserved words:
> 
> "string", "dstring", "wstring" -- I'm assuming that backward compatibility is the only reason these are not declared as keywords. Is there more to it than that?

These are aliases in the library. They have as much right to be keywords 
as "Socket" or "printf".

> "tuple" -- The use of tuples is ubiquitous in D. There is a a "tupleof" property for structs and unions. The "foreach" keyword knows about them. Yet there is no syntactic support for the thing itself. It is confusing to be required to define a template to access something the compiler creates. This may be just syntactic sugar but it's necessary sugar, IMHO.

I agree there should be syntactic support for tuples, but I don't think 
the "tuple" keyword is best. Instead, what about (int, float, 3) being a 
  tuple?

> Paul

The _real_ de facto keyword is the word "length" since when it's used 
inside an array index it shadows any variable called "length" outside.



More information about the Digitalmars-d mailing list