Stride

Jonathan M Davis jmdavisProg at gmx.com
Mon Feb 13 14:48:55 PST 2012


On Monday, February 13, 2012 23:27:37 Artur Skawina wrote:
> I'm not arguing that it _should_ be defined - just pointing out that the
> fact that it currently _is_ means one should be able to assume it works.
> After all there's only one D frontend and it comes from the vendor that
> also effectively controls the language spec - so it's reasonable to expect
> things that are documented, but could have been omitted, to work. If the
> compiler does not currently implement these spec parts it would be much
> better to say that the order *will* be L-T-R, but right now is undefined.
> That way users won't be mislead and if somebody else decides do to a D
> compiler it will be clear what should happen. Switching later from L-T-R to
> Undefined breaks backwards compatibility, but doing it the other way is
> harmless.

The reality of the matter is that the spec is untrustworthy. The compiler may 
or may not follow it, and just because the spec says something and the 
compiler doesn't agree doesn't mean that the spec is going to win out. It's 
better than it used to be, and I think that Walter fixed a number of things in 
it recently, but the spec is notorious for being out-of-date when it comes to 
the little details.

In this particular case, I'd fully expect that the spec is correct and that if 
the compiler doesn't follow suit, then it's buggy. However, it's also the kind 
of situation where I think that a bug would be very likely. So, I'd advise 
against relying on it, simply because the odds of your code being buggy (due 
to what is likely a compiler bug) are too high.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list