On Tuesday, 15 July 2014 at 17:26:12 UTC, Tofu Ninja wrote:
On Tuesday, 15 July 2014 at 17:09:14 UTC, H. S. Teoh via
Digitalmars-d wrote:
On Tue, Jul 15, 2014 at 04:52:34PM +, Israel Rodriguez via
Digitalmars-d wrote:
[...]
Nuh uh...The comma operator is too valuable to loose...
Please
On Wednesday, 23 July 2014 at 17:25:43 UTC, Yota wrote:
It appears Microsoft is musing the idea of adding this operator
to C# and VB.Net. Only instead of it being a comma, they're
going with a semicolon.
On 07/23/2014 10:59 AM, sigod wrote:
On Wednesday, 23 July 2014 at 17:25:43 UTC, Yota wrote:
It appears Microsoft is musing the idea of adding this operator to C#
and VB.Net. Only instead of it being a comma, they're going with a
semicolon.
On Wed, Jul 23, 2014 at 12:04:52PM -0700, Ali Çehreli via Digitalmars-d wrote:
[...]
Reminds me... Is everybody aware of D's for syntax?
import std.stdio;
void main()
{
for ( {
int i = 42;
double d = 1.5;
string s = hello;
} i 100; i *=
On Wednesday, 23 July 2014 at 17:59:42 UTC, sigod wrote:
On Wednesday, 23 July 2014 at 17:25:43 UTC, Yota wrote:
It appears Microsoft is musing the idea of adding this
operator to C# and VB.Net. Only instead of it being a comma,
they're going with a semicolon.
On Wednesday, 23 July 2014 at 19:04:52 UTC, Ali Çehreli wrote:
Reminds me... Is everybody aware of D's for syntax?
import std.stdio;
void main()
{
for ( {
int i = 42;
double d = 1.5;
string s = hello;
} i 100; i *= 2) {
writefln(In the
On 07/23/2014 12:04 PM, Ali Çehreli wrote:
On 07/23/2014 10:59 AM, sigod wrote:
On Wednesday, 23 July 2014 at 17:25:43 UTC, Yota wrote:
It appears Microsoft is musing the idea of adding this operator to C#
and VB.Net. Only instead of it being a comma, they're going with a
semicolon.
Spot the bug:
template flattenedType(R, uint depth = uint.max)
if (isInputRange!R)
{
static if (depth 0)
{
static if (!isInputRange!(typeof(R.init.front)))
{
alias flattenedType = typeof(R.init.front, depth - 1);
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote:
I'll give you a hint: the bug causes flattenedType!R to always
returned uint.
What is unexpected about that ?
On Tuesday, 15 July 2014 at 08:20:34 UTC, Martin Krejcirik wrote:
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote:
I'll give you a hint: the bug causes flattenedType!R to always
returned uint.
What is unexpected about that ?
It makes the behaviour of the template that's unexpected.
Meta:
Spot the bug:
We can start killing those commas in D 2.067 :-)
Bye,
bearophile
On Tue, Jul 15, 2014 at 08:42:17AM +, bearophile via Digitalmars-d wrote:
Meta:
Spot the bug:
We can start killing those commas in D 2.067 :-)
[...]
Is that the agreed-on schedule? I'd love to see the comma operator go,
too, but I don't recall the core devs agreeing on a deprecation
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote:
Spot the bug:
template flattenedType(R, uint depth = uint.max)
if (isInputRange!R)
{
static if (depth 0)
{
static if (!isInputRange!(typeof(R.init.front)))
{
alias
On Tuesday, 15 July 2014 at 16:01:37 UTC, Frustrated wrote:
This isn't a bug! It's a logic mistake.
Why the heck would you have such a line anyways?
alias flattenedType = typeof(R.init.front, depth - 1);
The 2nd argument to typeof makes no sense. It shouldn't be on
that line at all. Total
On 7/15/14, Frustrated via Digitalmars-d digitalmars-d@puremagic.com wrote:
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote:
The 2nd argument to typeof makes no sense. It shouldn't be on
that line at all. Total fail by the programmer.
Well yeah, real world programmers make mistakes.
On Tuesday, 15 July 2014 at 16:16:19 UTC, Andrej Mitrovic via
Digitalmars-d wrote:
On 7/15/14, Frustrated via Digitalmars-d
digitalmars-d@puremagic.com wrote:
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote:
The 2nd argument to typeof makes no sense. It shouldn't be on
that line at all.
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote:
Spot the bug:
template flattenedType(R, uint depth = uint.max)
if (isInputRange!R)
{
static if (depth 0)
{
static if (!isInputRange!(typeof(R.init.front)))
{
alias
On Tuesday, 15 July 2014 at 16:45:02 UTC, Jane Doe wrote:
On Tuesday, 15 July 2014 at 16:16:19 UTC, Andrej Mitrovic via
Digitalmars-d wrote:
On 7/15/14, Frustrated via Digitalmars-d
digitalmars-d@puremagic.com wrote:
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote:
The 2nd argument to
Jane Doe:
So, you wanna nerf everything that could produce the wrong
behavior?
A smarter question is: How to reduce the number of bugs in D code
decreasing the language functionality only very little, and
keeping the language handy (or making it even more handy)?
There is nothing in this
The reason for getting rid of it is because it's borderline
useless. It causes more accidental bugs than it enables
deliberate uses.
I find the comma op useful somemtimes. This example shows
absolutely nothing of comma wrongdoing. If anything, there could
be a warning for passing signed
On 7/15/14, Jane Doe via Digitalmars-d digitalmars-d@puremagic.com wrote:
Should be reduce the speed limit to 5mph because cars
can kill people?
No but maybe we should reduce the number of different accounts a
single person can use to troll around these forums.
On Tue, Jul 15, 2014 at 04:52:34PM +, Israel Rodriguez via Digitalmars-d
wrote:
[...]
Nuh uh...The comma operator is too valuable to loose...
Please cite an example where it is valuable?
T
--
Without outlines, life would be pointless.
Martin Krejcirik:
I find the comma op useful somemtimes.
Please shows us all the cases you can think of (or coming from
your own code, or coming from the Web) where you think it's
useful.
This example shows absolutely nothing of comma wrongdoing.
See my precedent answer.
If
On Tue, Jul 15, 2014 at 05:03:21PM +, Martin Krejcirik via Digitalmars-d
wrote:
The reason for getting rid of it is because it's borderline useless.
It causes more accidental bugs than it enables deliberate uses.
I find the comma op useful somemtimes.
Example?
T
--
Don't drink and
On Tuesday, 15 July 2014 at 17:09:14 UTC, H. S. Teoh via
Digitalmars-d wrote:
On Tue, Jul 15, 2014 at 04:52:34PM +, Israel Rodriguez via
Digitalmars-d wrote:
[...]
Nuh uh...The comma operator is too valuable to loose...
Please cite an example where it is valuable?
T
Yes please, I
Example?
For loop with multiple variables and various one liners of
questionable utility aside:
import std.stdio;
bool funk()
{
static int count;
return ++count 1 ? true : false;
}
void main()
{
bool flag = false;
if (flag funk)
writeln(a);
else if
On Tuesday, 15 July 2014 at 17:26:12 UTC, Tofu Ninja wrote:
Yes please, I legitimately can't think of any use case. I don't
understand why was this was ever introduced to D? What is the
use?
C compatibility as far as I know.
On Tue, Jul 15, 2014 at 05:26:11PM +, Tofu Ninja via Digitalmars-d wrote:
On Tuesday, 15 July 2014 at 17:09:14 UTC, H. S. Teoh via Digitalmars-d
wrote:
On Tue, Jul 15, 2014 at 04:52:34PM +, Israel Rodriguez via
Digitalmars-d wrote:
[...]
Nuh uh...The comma operator is too valuable to
On Tuesday, 15 July 2014 at 18:08:15 UTC, Martin Krejcirik wrote:
Example?
For loop with multiple variables and various one liners of
questionable utility aside:
import std.stdio;
bool funk()
{
static int count;
return ++count 1 ? true : false;
}
void main()
{
bool flag =
On 07/15/2014 11:08 AM, Martin Krejcirik wrote:
Example?
For loop with multiple variables and various one liners of questionable
utility aside:
import std.stdio;
bool funk()
{
static int count;
return ++count 1 ? true : false;
}
void main()
{
bool flag = false;
if
On Tuesday, 15 July 2014 at 18:08:15 UTC, Martin Krejcirik wrote:
Example?
For loop with multiple variables and various one liners of
questionable utility aside:
import std.stdio;
bool funk()
{
static int count;
return ++count 1 ? true : false;
}
void main()
{
bool flag =
On Tuesday, 15 July 2014 at 18:50:08 UTC, John Colvin wrote:
The comma operators entire job is to inject state changes where
the reader doesn't expect them. It's a misfeature of C that
we've sadly inherited and should rid ourselves from.
On Tuesday, 15 July 2014 at 18:50:08 UTC, John Colvin wrote:
and not just because I don't like the comma. I'd say it's
generally bad practice to hide that write to `flag` inside the
You are right for the 'final' code, but the point of my example
is, that I can move the flag to another if and
Martin Krejcirik:
Also an assignment is not allowed in a condition and without
the comma operator, it wouldn't be possible at all. That's way
too restrictive.
If I find code like yours, I refactor it ASAP :-)
Bye,
bearophile
On Tue, Jul 15, 2014 at 07:16:17PM +, Martin Krejcirik via Digitalmars-d
wrote:
On Tuesday, 15 July 2014 at 18:50:08 UTC, John Colvin wrote:
and not just because I don't like the comma. I'd say it's generally
bad practice to hide that write to `flag` inside the
You are right for the
On Tue, Jul 15, 2014 at 12:46:04PM -0700, H. S. Teoh via Digitalmars-d wrote:
On Tue, Jul 15, 2014 at 07:16:17PM +, Martin Krejcirik via Digitalmars-d
wrote:
On Tuesday, 15 July 2014 at 18:50:08 UTC, John Colvin wrote:
and not just because I don't like the comma. I'd say it's generally
36 matches
Mail list logo