Re: Interesting user mistake

2015-09-13 Thread Marco Leise via Digitalmars-d
Am Fri, 4 Sep 2015 19:13:45 -0400 schrieb Andrei Alexandrescu : > Most likely. My question was whether to put it in bugzilla or not. Guess > not. > > > Andrei Put it here: https://github.com/Hackerpilot/Dscanner/issues ;) -- Marco

Re: Interesting user mistake

2015-09-13 Thread Marco Leise via Digitalmars-d
Am Fri, 04 Sep 2015 13:38:26 + schrieb "Jonathan M Davis" : > I didn't realize that a unary + operator existed. I would have > assumed that +a as an expression would be illegal. It doesn't > even mean anything. > > - Jonathan M Davis Often (mostly with linear algebra)

Re: Interesting user mistake

2015-09-13 Thread Martin Nowak via Digitalmars-d
On 09/03/2015 06:46 PM, Andrei Alexandrescu wrote: > http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang > > > The gist of it is the user wrote =+ instead of +=. I wonder if we should > disallow during tokenization the sequence "=", "+",

Re: Interesting user mistake

2015-09-05 Thread Sebastiaan Koppe via Digitalmars-d
On Friday, 4 September 2015 at 23:08:21 UTC, Andrei Alexandrescu wrote: On 09/04/2015 12:39 PM, skoppe wrote: On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The

Re: Interesting user mistake

2015-09-05 Thread ponce via Digitalmars-d
On Friday, 4 September 2015 at 18:55:03 UTC, Mint wrote: On Friday, 4 September 2015 at 17:17:26 UTC, Andrei A simple solution would be to just have unary + perform integer promotion, as it does in C. Wait, what? Is this another secret difference from C integer promotion rules?

Re: Interesting user mistake

2015-09-05 Thread Mint via Digitalmars-d
On Saturday, 5 September 2015 at 10:45:35 UTC, ponce wrote: On Friday, 4 September 2015 at 18:55:03 UTC, Mint wrote: On Friday, 4 September 2015 at 17:17:26 UTC, Andrei A simple solution would be to just have unary + perform integer promotion, as it does in C. Wait, what? Is this another

Re: Interesting user mistake

2015-09-04 Thread Steven Schveighoffer via Digitalmars-d
On 9/3/15 5:59 PM, Brian Schott wrote: On Thursday, 3 September 2015 at 17:17:26 UTC, Steven Schveighoffer wrote: What about all other operations that may be typos from op= where op is also a unary operator? e.g. =- We'd have to special-case '*': a=*b; You could say the same thing for =-:

Re: Interesting user mistake

2015-09-04 Thread Jonathan M Davis via Digitalmars-d
On Friday, 4 September 2015 at 14:14:43 UTC, Mike James wrote: On Friday, 4 September 2015 at 14:05:09 UTC, Jonathan M Davis wrote: On Friday, 4 September 2015 at 13:55:03 UTC, Jonathan M Davis wrote: [...] [snip] [...] Isn't it called Maximal Munch...

Re: Interesting user mistake

2015-09-04 Thread Jonathan M Davis via Digitalmars-d
On Friday, 4 September 2015 at 13:55:03 UTC, Jonathan M Davis wrote: On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+ instead of +=.

Re: Interesting user mistake

2015-09-04 Thread immu via Digitalmars-d
On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: I wonder if we should disallow during tokenization the sequence "=", "+", whitespace. Surely it's not a formatting anyone would aim for, but instead a misspelling of +=. Andrei Please don't. That would feel like a

Re: Interesting user mistake

2015-09-04 Thread Mike James via Digitalmars-d
On Friday, 4 September 2015 at 14:05:09 UTC, Jonathan M Davis wrote: On Friday, 4 September 2015 at 13:55:03 UTC, Jonathan M Davis wrote: [...] [snip] [...] Isn't it called Maximal Munch... https://en.wikipedia.org/wiki/Maximal_munch Regards, --

Re: Interesting user mistake

2015-09-04 Thread via Digitalmars-d
On Friday, 4 September 2015 at 12:02:26 UTC, Steven Schveighoffer wrote: On 9/3/15 5:59 PM, Brian Schott wrote: On Thursday, 3 September 2015 at 17:17:26 UTC, Steven Schveighoffer wrote: What about all other operations that may be typos from op= where op is also a unary operator? e.g. =-

Re: Interesting user mistake

2015-09-04 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 3 September 2015 at 18:31:59 UTC, Meta wrote: On Thursday, 3 September 2015 at 17:12:31 UTC, H. S. Teoh wrote: Is there a way for the lexer to check for the specific character sequence '=', '+', whitespace and not others (e.g. '=', whitespace, '+')? IOW, "a =+ b" will be

Re: Interesting user mistake

2015-09-04 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+ instead of +=. I wonder if we should disallow during tokenization the sequence "=",

Re: Interesting user mistake

2015-09-04 Thread Steven Schveighoffer via Digitalmars-d
On 9/4/15 10:05 AM, Jonathan M Davis wrote: On Friday, 4 September 2015 at 13:55:03 UTC, Jonathan M Davis wrote: On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The

Re: Interesting user mistake

2015-09-04 Thread via Digitalmars-d
On Friday, 4 September 2015 at 15:13:08 UTC, Steven Schveighoffer wrote: I think that is Andrei's original suggestion: the sequence "=", "+", whitespace should be rejected. He says nothing about "=","+" without the whitespace. Yup.

Re: Interesting user mistake

2015-09-04 Thread skoppe via Digitalmars-d
On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+ instead of +=. I wonder if we should disallow during tokenization the sequence "=",

Re: Interesting user mistake

2015-09-04 Thread Andrei Alexandrescu via Digitalmars-d
On 09/03/2015 01:08 PM, H. S. Teoh via Digitalmars-d wrote: On Thu, Sep 03, 2015 at 12:46:29PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+ instead

Re: Interesting user mistake

2015-09-04 Thread Andrei Alexandrescu via Digitalmars-d
On 09/03/2015 01:15 PM, "Luís Marques wrote: On Thursday, 3 September 2015 at 17:12:31 UTC, H. S. Teoh wrote: Is there a way for the lexer to check for the specific character sequence '=', '+', whitespace and not others (e.g. '=', whitespace, '+')? IOW, "a =+ b" will be

Re: Interesting user mistake

2015-09-04 Thread Observer via Digitalmars-d
On Thursday, 3 September 2015 at 17:15:25 UTC, Enamex wrote: On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: we should disallow during tokenization the sequence "=", "+", whitespace. Surely it's not a formatting anyone would aim for, but instead a misspelling of +=.

Re: Interesting user mistake

2015-09-04 Thread Mint via Digitalmars-d
On Friday, 4 September 2015 at 17:17:26 UTC, Andrei Alexandrescu wrote: On 09/03/2015 01:08 PM, H. S. Teoh via Digitalmars-d wrote: [...] Is there a way for the lexer to check for the specific character sequence '=', '+', whitespace and not others (e.g. '=', whitespace, '+')? IOW, "a =+ b"

Re: Interesting user mistake

2015-09-04 Thread Andrej Mitrovic via Digitalmars-d
On 9/3/15, Andrei Alexandrescu via Digitalmars-d wrote: > http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang > > The gist of it is the user wrote =+ instead of +=. I wonder if we should > disallow during tokenization

Re: Interesting user mistake

2015-09-04 Thread H. S. Teoh via Digitalmars-d
On Fri, Sep 04, 2015 at 10:41:05PM +0200, Andrej Mitrovic via Digitalmars-d wrote: > On 9/3/15, Andrei Alexandrescu via Digitalmars-d > wrote: > > http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang > > > > The gist of

Re: Interesting user mistake

2015-09-04 Thread Andrej Mitrovic via Digitalmars-d
On 9/4/15, H. S. Teoh via Digitalmars-d wrote: > https://en.wikipedia.org/wiki/Parkinson%27s_law_of_triviality The irony is that I now spend most of my time thinking about really pressing issues, I can finally see the forest for the trees. But I'm no longer an OSS

Re: Interesting user mistake

2015-09-04 Thread Andrei Alexandrescu via Digitalmars-d
On 09/04/2015 08:47 AM, immu wrote: On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: I wonder if we should disallow during tokenization the sequence "=", "+", whitespace. Surely it's not a formatting anyone would aim for, but instead a misspelling of +=. Andrei

Re: Interesting user mistake

2015-09-04 Thread Andrei Alexandrescu via Digitalmars-d
On 09/04/2015 08:02 AM, Steven Schveighoffer wrote: On 9/3/15 5:59 PM, Brian Schott wrote: On Thursday, 3 September 2015 at 17:17:26 UTC, Steven Schveighoffer wrote: What about all other operations that may be typos from op= where op is also a unary operator? e.g. =- We'd have to

Re: Interesting user mistake

2015-09-04 Thread Andrei Alexandrescu via Digitalmars-d
On 09/04/2015 02:55 PM, Mint wrote: On Friday, 4 September 2015 at 17:17:26 UTC, Andrei Alexandrescu wrote: On 09/03/2015 01:08 PM, H. S. Teoh via Digitalmars-d wrote: [...] Is there a way for the lexer to check for the specific character sequence '=', '+', whitespace and not others (e.g.

Re: Interesting user mistake

2015-09-04 Thread Andrei Alexandrescu via Digitalmars-d
On 09/04/2015 04:41 PM, Andrej Mitrovic via Digitalmars-d wrote: On 9/3/15, Andrei Alexandrescu via Digitalmars-d wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+

Re: Interesting user mistake

2015-09-04 Thread Steven Schveighoffer via Digitalmars-d
On 9/4/15 9:38 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= wrote: On Friday, 4 September 2015 at 12:02:26 UTC, Steven Schveighoffer wrote: On 9/3/15 5:59 PM, Brian Schott wrote: On Thursday, 3 September 2015 at 17:17:26 UTC, Steven Schveighoffer wrote: What about all other operations

Re: Interesting user mistake

2015-09-04 Thread Andrei Alexandrescu via Digitalmars-d
On 09/04/2015 12:39 PM, skoppe wrote: On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+ instead of +=. I wonder if we should

Re: Interesting user mistake

2015-09-03 Thread via Digitalmars-d
On Thursday, 3 September 2015 at 17:06:15 UTC, Luís Marques wrote: Ah, there was a button way on the top to apply the filter. (). All results are irrelevant, so I guess it's unlikely to break anything. Urg, too trigger happy today. Bug?:

Re: Interesting user mistake

2015-09-03 Thread Meta via Digitalmars-d
On Thursday, 3 September 2015 at 17:12:31 UTC, H. S. Teoh wrote: Is there a way for the lexer to check for the specific character sequence '=', '+', whitespace and not others (e.g. '=', whitespace, '+')? IOW, "a =+ b" will be prohibited, but "a = + b" will be allowed. If so, I agree with

Re: Interesting user mistake

2015-09-03 Thread H. S. Teoh via Digitalmars-d
On Thu, Sep 03, 2015 at 06:44:54PM +, Adam D. Ruppe via Digitalmars-d wrote: > On Thursday, 3 September 2015 at 18:42:37 UTC, H. S. Teoh wrote: > >Now, in C, unary + actually does something -- it causes promotion of > >narrow ints to int. I'm not sure if it does that in D as well. > > what is

Re: Interesting user mistake

2015-09-03 Thread via Digitalmars-d
On Thursday, 3 September 2015 at 18:31:59 UTC, Meta wrote: On that note, though, the unary + operator is totally useless in D... maybe we should get rid of that instead? (Then "=+" will automatically be an error.) T Worse than useless; it doesn't even behave as you would expect. import

Re: Interesting user mistake

2015-09-03 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 3 September 2015 at 18:42:37 UTC, H. S. Teoh wrote: Now, in C, unary + actually does something -- it causes promotion of narrow ints to int. I'm not sure if it does that in D as well. what is this, javascript? a|0 :P Seriously though, I never knew that. And I can't find where

Re: Interesting user mistake

2015-09-03 Thread Mint via Digitalmars-d
On Thursday, 3 September 2015 at 18:31:59 UTC, Meta wrote: Worse than useless; it doesn't even behave as you would expect. import std.stdio; void main() { auto a = -1; writeln(+a); //Prints -1 writeln(-a); //Prints 1 } At least unary - does something. I mean, if

Re: Interesting user mistake

2015-09-03 Thread H. S. Teoh via Digitalmars-d
On Thu, Sep 03, 2015 at 06:31:57PM +, Meta via Digitalmars-d wrote: > On Thursday, 3 September 2015 at 17:12:31 UTC, H. S. Teoh wrote: > >Is there a way for the lexer to check for the specific character > >sequence '=', '+', whitespace and not others (e.g. '=', whitespace, > >'+')? IOW, "a =+

Re: Interesting user mistake

2015-09-03 Thread via Digitalmars-d
On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: The gist of it is the user wrote =+ instead of +=. I wonder if we should disallow during tokenization the sequence "=", "+", whitespace. Surely it's not a formatting anyone would aim for, but instead a misspelling of +=.

Re: Interesting user mistake

2015-09-03 Thread H. S. Teoh via Digitalmars-d
On Thu, Sep 03, 2015 at 12:46:29PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: > http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang > > The gist of it is the user wrote =+ instead of +=. I wonder if we > should disallow during

Re: Interesting user mistake

2015-09-03 Thread via Digitalmars-d
On Thursday, 3 September 2015 at 17:12:31 UTC, H. S. Teoh wrote: Is there a way for the lexer to check for the specific character sequence '=', '+', whitespace and not others (e.g. '=', whitespace, '+')? IOW, "a =+ b" will be prohibited, but "a = + b" will be allowed. If so, I agree with

Re: Interesting user mistake

2015-09-03 Thread Steven Schveighoffer via Digitalmars-d
On 9/3/15 1:08 PM, H. S. Teoh via Digitalmars-d wrote: On Thu, Sep 03, 2015 at 12:46:29PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+ instead of +=.

Re: Interesting user mistake

2015-09-03 Thread Enamex via Digitalmars-d
On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: we should disallow during tokenization the sequence "=", "+", whitespace. Surely it's not a formatting anyone would aim for, but instead a misspelling of +=. Andrei Wasn't the original design for these operators in

Interesting user mistake

2015-09-03 Thread Andrei Alexandrescu via Digitalmars-d
http://stackoverflow.com/questions/32369114/leap-years-not-working-in-date-and-time-program-in-dlang The gist of it is the user wrote =+ instead of +=. I wonder if we should disallow during tokenization the sequence "=", "+", whitespace. Surely it's not a formatting anyone would aim for, but

Re: Interesting user mistake

2015-09-03 Thread via Digitalmars-d
On Thursday, 3 September 2015 at 17:03:26 UTC, Luís Marques wrote: I tried to search for that pattern () and it says 9 results for D, but clicking the D filter doesn't seem to do anything, so I'm not sure what the actual cases are. Ah, there was a button way

Re: Interesting user mistake

2015-09-03 Thread jmh530 via Digitalmars-d
On Thursday, 3 September 2015 at 18:37:53 UTC, Luís Marques wrote: I like to use the unary plus *in some cases* of tabular data, to reinforce the signess. Something like this: auto foo = [ +1234, -5678, -4242, + ]; I don't do it often, but I've seen lots of people do it

Re: Interesting user mistake

2015-09-03 Thread Brian Schott via Digitalmars-d
On Thursday, 3 September 2015 at 17:17:26 UTC, Steven Schveighoffer wrote: What about all other operations that may be typos from op= where op is also a unary operator? e.g. =- We'd have to special-case '*': a=*b;

Re: Interesting user mistake

2015-09-03 Thread H. S. Teoh via Digitalmars-d
On Thu, Sep 03, 2015 at 09:59:52PM +, Brian Schott via Digitalmars-d wrote: > On Thursday, 3 September 2015 at 17:17:26 UTC, Steven Schveighoffer wrote: > >What about all other operations that may be typos from op= where op > >is also a unary operator? e.g. =- > > We'd have to special-case