Walter Bright wrote:
BLS wrote:
Walter Bright wrote:
BLS wrote:
("more intuitive than" is not ..ahem.. is not a good enough reason)
I think it is a very good reason. Of course, we can argue about if it
is actually intuitive or not.
ok. but that's only eye candy, no ?
Intuitive has a lo
Steven Schveighoffer:
> Does this compile:
>
> class C {}
>
> ubyte foo(C n)
> {
>return true ? 255 : n;
> }
>
> (don't have the latest compiler installed yet, so I couldn't check it
> myself)
It doesn't compile (DMD v2.031):
temp.d(5): Error: incompatible types for ((255) ? (n)): 'int' a
On Fri, 17 Jul 2009 09:46:11 -0400, Don wrote:
Steven Schveighoffer wrote:
On Fri, 17 Jul 2009 08:08:23 -0400, Don wrote:
In this case, I think bearophile's right: it's just a problem with
range propagation of the ?: operator. I think the compiler should be
required to do the semantics a
Steven Schveighoffer wrote:
On Fri, 17 Jul 2009 08:08:23 -0400, Don wrote:
In this case, I think bearophile's right: it's just a problem with
range propagation of the ?: operator. I think the compiler should be
required to do the semantics analysis for single expressions. Not
more, not less.
On Fri, 17 Jul 2009 08:08:23 -0400, Don wrote:
In this case, I think bearophile's right: it's just a problem with range
propagation of the ?: operator. I think the compiler should be required
to do the semantics analysis for single expressions. Not more, not less.
Why? What is the benefit
BCS wrote:
Reply to bearophile,
John C:
Did you not read the change log?
"Implicit integral conversions that could result in loss of
significant bits are no longer allowed."
This was the code:
ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n));
That last n is guaranteed to fit inside an ubyte
I
BCS wrote:
Reply to bearophile,
John C:
Did you not read the change log?
"Implicit integral conversions that could result in loss of
significant bits are no longer allowed."
This was the code:
ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n));
That last n is guaranteed to fit inside an ubyte (ye
Dnia 2009-07-17, piÄ… o godzinie 02:32 +0200, BLS pisze:
> bearophile wrote:
> > BLS:
> bearophile brings in several times Scala/OCAML like pattern matching.
> Why not using that for constraints ?
> >>> I have no idea how that works, though Bartosz has been looking into it.
> >> O well, I