On 2011-08-13 00:08, Walter Bright wrote:
On 8/12/2011 11:32 AM, Jacob Carlborg wrote:
On 2011-08-12 20:16, Walter Bright wrote:
On 8/12/2011 8:52 AM, Jonathan M Davis wrote:
it's a practice that many
people don't seem to follow (in both C/C++ and D), since it's so
natural to
use int (or auto
On 08/13/2011 12:37 AM, Ellery Newcomer wrote:
On 08/12/2011 04:06 PM, Don wrote:
No, it was specifically disallowed.
Version D 2.037 Dec 3, 2009
New/Changed Features
No more comma operators allowed between [ ].
I think that was for type declarations, not index expressions.
you can still do
On 08/12/2011 11:06 PM, Don wrote:
Timon Gehr wrote:
On 08/12/2011 09:32 PM, bearophile wrote:
Timon Gehr:
foreach_reverse(i;0..array.length) writeln(array[i]),i--;
I'd like to statically forbid some more usages of the comma operator
in D :-)
Some of them are already forbidden compared to
On Fri, 12 Aug 2011 20:36:32 +0200, Jacob Carlborg wrote:
On 2011-08-12 20:26, Simen Kjaeraas wrote:
On Fri, 12 Aug 2011 19:19:09 +0200, Marco Leise
wrote:
This way it is actually fun to cripple the for loop, yay. Still if
people started to argue that it is a bad idea to modify variables in
On 08/12/2011 04:06 PM, Don wrote:
No, it was specifically disallowed.
Version D 2.037 Dec 3, 2009
New/Changed Features
No more comma operators allowed between [ ].
I think that was for type declarations, not index expressions.
you can still do this:
import std.stdio;
struct X{
void opI
On 8/12/2011 11:32 AM, Jacob Carlborg wrote:
On 2011-08-12 20:16, Walter Bright wrote:
On 8/12/2011 8:52 AM, Jonathan M Davis wrote:
it's a practice that many
people don't seem to follow (in both C/C++ and D), since it's so
natural to
use int (or auto in D),
Back in the olden days of C, it wa
Timon Gehr wrote:
On 08/12/2011 09:32 PM, bearophile wrote:
Timon Gehr:
foreach_reverse(i;0..array.length) writeln(array[i]),i--;
I'd like to statically forbid some more usages of the comma operator
in D :-)
Some of them are already forbidden compared to C. This is valid C code:
int main
On 08/12/2011 09:32 PM, bearophile wrote:
Timon Gehr:
foreach_reverse(i;0..array.length) writeln(array[i]),i--;
I'd like to statically forbid some more usages of the comma operator in D :-)
Some of them are already forbidden compared to C. This is valid C code:
int main() {
int array[5
On 08/12/2011 08:32 PM, Jacob Carlborg wrote:
On 2011-08-12 20:16, Walter Bright wrote:
On 8/12/2011 8:52 AM, Jonathan M Davis wrote:
it's a practice that many
people don't seem to follow (in both C/C++ and D), since it's so
natural to
use int (or auto in D),
Back in the olden days of C, it w
Jonathan M Davis wrote:
On Friday, August 12, 2011 12:39:01 Don wrote:
kennytm wrote:
Don wrote:
I've had a look at a dozen or so of these, and they were all real. I
didn't see any which require a cast to "make the compiler shut up".
That's pretty impressive. In C++ I find that such messages
Timon Gehr:
> foreach_reverse(i;0..array.length) writeln(array[i]),i--;
I'd like to statically forbid some more usages of the comma operator in D :-)
Some of them are already forbidden compared to C. This is valid C code:
int main() {
int array[5];
int i = 1;
int j = 2;
array[i,
On 2011-08-12 20:26, Simen Kjaeraas wrote:
On Fri, 12 Aug 2011 19:19:09 +0200, Marco Leise wrote:
This way it is actually fun to cripple the for loop, yay. Still if
people started to argue that it is a bad idea to modify variables in
the condition I'd silently agree. So a look at "foreach_rever
On 2011-08-12 20:16, Walter Bright wrote:
On 8/12/2011 8:52 AM, Jonathan M Davis wrote:
it's a practice that many
people don't seem to follow (in both C/C++ and D), since it's so
natural to
use int (or auto in D),
Back in the olden days of C, it was "best practice" to use int as an
index. Time
On Fri, 12 Aug 2011 19:19:09 +0200, Marco Leise wrote:
Am 12.08.2011, 17:48 Uhr, schrieb Simen Kjaeraas
:
On Fri, 12 Aug 2011 14:55:26 +0200, Marco Leise
wrote:
Am 12.08.2011, 12:22 Uhr, schrieb kennytm :
Don wrote:
I've had a look at a dozen or so of these, and they were all real
On 8/12/2011 8:52 AM, Jonathan M Davis wrote:
it's a practice that many
people don't seem to follow (in both C/C++ and D), since it's so natural to
use int (or auto in D),
Back in the olden days of C, it was "best practice" to use int as an index.
Times have changed, but old habits die hard.
Am 12.08.2011, 17:48 Uhr, schrieb Simen Kjaeraas :
On Fri, 12 Aug 2011 14:55:26 +0200, Marco Leise
wrote:
Am 12.08.2011, 12:22 Uhr, schrieb kennytm :
Don wrote:
I've had a look at a dozen or so of these, and they were all real. I
didn't see any which require a cast to "make the compile
On Friday, August 12, 2011 12:39:01 Don wrote:
> kennytm wrote:
> > Don wrote:
> >> I've had a look at a dozen or so of these, and they were all real. I
> >> didn't see any which require a cast to "make the compiler shut up".
> >> That's pretty impressive. In C++ I find that such messages are near
On Fri, 12 Aug 2011 14:55:26 +0200, Marco Leise wrote:
Am 12.08.2011, 12:22 Uhr, schrieb kennytm :
Don wrote:
I've had a look at a dozen or so of these, and they were all real. I
didn't see any which require a cast to "make the compiler shut up".
That's pretty impressive. In C++ I find tha
Am 12.08.2011, 15:44 Uhr, schrieb Timon Gehr :
On 08/12/2011 03:33 PM, Marco Leise wrote:
Am 12.08.2011, 15:08 Uhr, schrieb bearophile :
Marco Leise:
Just remember that reverse loops are written like this:
for (size_t i = x.length; i-- > 0; ) {...}
Thankfully in D there is foreach_revers
Am 12.08.2011, 14:55 Uhr, schrieb Marco Leise :
for (size_t i = x.length; i-- > 0; ) {...}
Actually this is probably better:
for (auto i = x.length; i > 0; )
{
--i;
...
}
On 08/12/2011 03:33 PM, Marco Leise wrote:
Am 12.08.2011, 15:08 Uhr, schrieb bearophile :
Marco Leise:
Just remember that reverse loops are written like this:
for (size_t i = x.length; i-- > 0; ) {...}
Thankfully in D there is foreach_reverse :-)
import std.stdio;
void main() {
auto arra
Am 12.08.2011, 15:08 Uhr, schrieb bearophile :
Marco Leise:
Just remember that reverse loops are written like this:
for (size_t i = x.length; i-- > 0; ) {...}
Thankfully in D there is foreach_reverse :-)
import std.stdio;
void main() {
auto array = [10, 20, 30];
for (size_t i = a
On 2011-08-12 14:55, Marco Leise wrote:
Am 12.08.2011, 12:22 Uhr, schrieb kennytm :
Don wrote:
I've had a look at a dozen or so of these, and they were all real. I
didn't see any which require a cast to "make the compiler shut up".
That's pretty impressive. In C++ I find that such messages a
On 08/12/2011 03:08 PM, bearophile wrote:
Marco Leise:
Just remember that reverse loops are written like this:
for (size_t i = x.length; i--> 0; ) {...}
Thankfully in D there is foreach_reverse :-)
import std.stdio;
void main() {
auto array = [10, 20, 30];
for (size_t i = array
Marco Leise:
> Just remember that reverse loops are written like this:
>
> for (size_t i = x.length; i-- > 0; ) {...}
Thankfully in D there is foreach_reverse :-)
import std.stdio;
void main() {
auto array = [10, 20, 30];
for (size_t i = array.length; i-- > 0; )
writeln(i, " "
Am 12.08.2011, 12:22 Uhr, schrieb kennytm :
Don wrote:
I've had a look at a dozen or so of these, and they were all real. I
didn't see any which require a cast to "make the compiler shut up".
That's pretty impressive. In C++ I find that such messages are nearly
always false positives.
The on
kennytm wrote:
Don wrote:
I've had a look at a dozen or so of these, and they were all real. I
didn't see any which require a cast to "make the compiler shut up".
That's pretty impressive. In C++ I find that such messages are nearly
always false positives.
The one case where it's a bit annoyi
Don wrote:
> I've had a look at a dozen or so of these, and they were all real. I
> didn't see any which require a cast to "make the compiler shut up".
> That's pretty impressive. In C++ I find that such messages are nearly
> always false positives.
>
> The one case where it's a bit annoying is
bearophile wrote:
I have added this bit of code to my dmd, it gives warnings in cases of integral
signed-unsigned comparisons:
https://github.com/D-Programming-Language/dmd/pull/119
Then I have compiled Phobos (with unittests) with the -wi switch, this has
generated some of those signed-unsign
I have added this bit of code to my dmd, it gives warnings in cases of integral
signed-unsigned comparisons:
https://github.com/D-Programming-Language/dmd/pull/119
Then I have compiled Phobos (with unittests) with the -wi switch, this has
generated some of those signed-unsigned warning messages,
30 matches
Mail list logo