study: use checkedint as a drop-in replacement of native long

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Mar 24 21:58:50 UTC 2021


On Wed, Mar 24, 2021 at 09:40:07PM +0000, Gregor Mückl via Digitalmars-d wrote:
> On Wednesday, 24 March 2021 at 21:28:24 UTC, H. S. Teoh wrote:
> > On Wed, Mar 24, 2021 at 06:38:07PM +0000, Gregor Mückl via Digitalmars-d
> > wrote:
> > > On Wednesday, 24 March 2021 at 17:38:14 UTC, H. S. Teoh wrote:
> > > > Since there is only one sensible meaning of `a = b = c`...
> > > 
> > > If I'm reading the spec on expressions right, the compiler is
> > > actually free to interpret that as (a = b) = c if it feels
> > > particularly adventurous. The evaluation order of assignment
> > > operations is explicitly undefined...
> > 
> > Link to spec please?  If what you say is true, that sounds like an
> > error in the spec.  Walter has said many times that evaluation order
> > in D is left to right, unless otherwise indicated. Having it
> > unspecified just leads to a huge can o' worms.
> > 
> 
> See point 1 under "Implementation Defined":
> https://dlang.org/spec/expression.html#order-of-evaluation
> 
> "The order of evaluation of the operands of AssignExpression."

The keyword here is "operands". The order of evaluation of the
*operands* is implementation-defined; the order of the evaluation of the
assignment *operators* is from right to left.


T

-- 
Only boring people get bored. -- JM


More information about the Digitalmars-d mailing list