Re: [OT] Swift removing minor features to piss me off

2016-05-03 Thread default0 via Digitalmars-d
On Monday, 2 May 2016 at 14:32:30 UTC, Steven Schveighoffer wrote: On 5/2/16 6:55 AM, ag0aep6g wrote: And anyone who says "bleh, you can just use a while loop if you need that" I want to beat with a semi-colon over the head. -Steve Apparently, Swift also does not have goto. For all

Re: [OT] Swift removing minor features to piss me off

2016-05-02 Thread Steven Schveighoffer via Digitalmars-d
On 5/2/16 6:55 AM, ag0aep6g wrote: On 02.05.2016 09:45, Jacob Carlborg wrote: Does it matter? I thought the idea was to get the same behavior not explicitly a range. default0 said that D's ranges would be more awkward than a for loop. I think D's iota is fine. D's special syntax is even

Re: [OT] Swift removing minor features to piss me off

2016-05-02 Thread Shachar Shemesh via Digitalmars-d
On 29/04/16 04:36, Walter Bright wrote: On 4/28/2016 2:32 PM, Daniel Kozak via Digitalmars-d wrote: Wierd, I am almost sure it does not work for me last time when I tried :) That's because in dmd there's the line: if (strcmp(user, "Daniel") == 0) setScoping(false); It's a feature!

Re: [OT] Swift removing minor features to piss me off

2016-05-02 Thread ag0aep6g via Digitalmars-d
On 02.05.2016 09:45, Jacob Carlborg wrote: Does it matter? I thought the idea was to get the same behavior not explicitly a range. default0 said that D's ranges would be more awkward than a for loop. I think D's iota is fine. D's special syntax is even nicer, but it's a language thing. And

Re: [OT] Swift removing minor features to piss me off

2016-05-02 Thread Enamex via Digitalmars-d
On Friday, 29 April 2016 at 12:06:40 UTC, Nick Treleaven wrote: A complication with the delegate way is break/continue/return in the statement block, but I suppose it already works for opApply. I'm curious: what does this actually lower to when compiling?

Re: [OT] Swift removing minor features to piss me off

2016-05-02 Thread Jacob Carlborg via Digitalmars-d
On 29/04/16 14:06, Nick Treleaven wrote: Or maybe with macros supporting a trailing statement as the last argument: macro forever($(Statement st)); $forever { } I tried to be a bit conservative, I don't mind macros :) -- /Jacob Carlborg

Re: [OT] Swift removing minor features to piss me off

2016-05-02 Thread Jacob Carlborg via Digitalmars-d
On 29/04/16 14:24, ag0aep6g wrote: Yeah, but that's special syntax, not a range. Does it matter? I thought the idea was to get the same behavior not explicitly a range. -- /Jacob Carlborg

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Chris via Digitalmars-d
On Friday, 29 April 2016 at 03:44:47 UTC, Nick Sabalausky wrote: Not surprised. Removing features is all the rage in the software world these days. This is one fad I can't wait to see die. Hopefully this one won't drag on as ridiculously log as pants-sagging did, but I'm not holding my

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread bearophile via Digitalmars-d
I think Swift is not yet stable. So if you want to use it you have to deal with language changes (D2 is stable). In a modern language ++ and -- are OK only if they return void. Otherwise they are bug-prone and allow people to write less readable code. C for() loops are powerful, but a bit

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread ag0aep6g via Digitalmars-d
On 29.04.2016 08:23, Jacob Carlborg wrote: foreach (i; 0 .. 5) Yeah, but that's special syntax, not a range.

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Nick Treleaven via Digitalmars-d
On Thursday, 28 April 2016 at 22:37:41 UTC, H. S. Teoh wrote: I find for(;;) far more logical than other vacuous workarounds like while(1) or while(true). It's only because of C that all the for arguments can be left out, I'd rather have: while {...} I.e. it defaults to true. 'A while' is

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Nick Treleaven via Digitalmars-d
On Friday, 29 April 2016 at 06:27:07 UTC, Jacob Carlborg wrote: In an ideal world the language would support trailing delegate syntax allowing this to work without any language support: forever { } Translated to: forever({ }); Or maybe with macros supporting a trailing statement as the

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Walter Bright via Digitalmars-d
On 4/28/2016 11:22 PM, Seb wrote: `foreach (i; 0..5)` seems to cover 95% of my for uses and it looks a lot cleaner. I am actually pretty happy that D has this! foreach neatly eliminates most fencepost bugs.

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2016-04-29 00:37, H. S. Teoh via Digitalmars-d wrote: Of course, in an ideal world you'd have a "forever" keyword instead, but using up an entire keyword just for this one specific kind of loop seems a little excessive. So for(;;) seems like the perfect balance between idealism and

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2016-04-29 07:34, ag0aep6g wrote: I think it's fine with a D range: `foreach (i; iota(0, 5))` is less noisy than the `for` variant. foreach (i; 0 .. 5) -- /Jacob Carlborg

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2016-04-29 03:38, Stefan Koch wrote: That one was really funny! ... or maybe I am just thinking this because it is 3 am here... No, it's funny any time of the day :) -- /Jacob Carlborg

Re: [OT] Swift removing minor features to piss me off

2016-04-29 Thread Seb via Digitalmars-d
On Friday, 29 April 2016 at 05:34:21 UTC, ag0aep6g wrote: On 29.04.2016 06:51, default0 wrote: for(int i = 0; i < 5; ++i) arr1[i] += arr2[i]; And for(int i = 0; i < 5; ++i) arr[i].SetIndex(i); My guess, not knowing Swift, is that you will now implement these in a more verbose,

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread ag0aep6g via Digitalmars-d
On 29.04.2016 06:51, default0 wrote: for(int i = 0; i < 5; ++i) arr1[i] += arr2[i]; And for(int i = 0; i < 5; ++i) arr[i].SetIndex(i); My guess, not knowing Swift, is that you will now implement these in a more verbose, harder to read way using while or use some concept similar to

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Walter Bright via Digitalmars-d
On 4/28/2016 8:44 PM, Nick Sabalausky wrote: Hopefully this one won't drag on as ridiculously log as pants-sagging did, Did? past tense? Dang, I'm out of step again. I better get a belt.

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Walter Bright via Digitalmars-d
On 4/28/2016 9:06 PM, Adam D. Ruppe wrote: But, this might sound nuts, but I still think one of the simplest languages I know is assembly language. It just does what you tell it, one step at a time, with each line basically looking the same, it is light on syntax and language rules (unless you

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread default0 via Digitalmars-d
On Friday, 29 April 2016 at 04:06:24 UTC, Adam D. Ruppe wrote: Though I'm on the fence of ++. Sure, I like it, but when I have to use a language that doesn't have it, +=1 works just as well (I just waste a little time on the edit cycle because I always use ++ first out of habit.) I find ++

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Nick Sabalausky via Digitalmars-d
On 04/28/2016 02:49 PM, Steven Schveighoffer wrote: This is what bouncing the rubble looks like. 1. Swift 3 will no longer allow mutable variables as parameters. Instead, your parameters will be immutable, or reference (inout). To fix this, you can assign your immutable variable to a mutable

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 28, 2016 at 10:49:19PM +, Adam D. Ruppe via Digitalmars-d wrote: > On Thursday, 28 April 2016 at 22:37:41 UTC, H. S. Teoh wrote: > >Of course, in an ideal world you'd have a "forever" keyword instead, > >but using up an entire keyword just for this one specific kind of > >loop

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Stefan Koch via Digitalmars-d
On Friday, 29 April 2016 at 01:36:26 UTC, Walter Bright wrote: That's because in dmd there's the line: if (strcmp(user, "Daniel") == 0) setScoping(false); It's a feature! That one was really funny! ... or maybe I am just thinking this because it is 3 am here...

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Walter Bright via Digitalmars-d
On 4/28/2016 2:32 PM, Daniel Kozak via Digitalmars-d wrote: Wierd, I am almost sure it does not work for me last time when I tried :) That's because in dmd there's the line: if (strcmp(user, "Daniel") == 0) setScoping(false); It's a feature!

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Jack Stouffer via Digitalmars-d
On Thursday, 28 April 2016 at 18:53:21 UTC, Steven Schveighoffer wrote: grrr... and they removed C-style for statements (i.e. for(;;)) I can understand wanting to remove bad ideas, but 1) removing something this fundamental to the language and 2) removing something that not only doesn't lead

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 28 April 2016 at 22:37:41 UTC, H. S. Teoh wrote: Of course, in an ideal world you'd have a "forever" keyword instead, but using up an entire keyword just for this one specific kind of loop seems a little excessive. forever: { // stuff goto hell; // who needs break? //

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Timon Gehr via Digitalmars-d
On 28.04.2016 22:01, Seb wrote: I agree with the other people on this list - cleaning up a language is great and should be done. `++` might be a bad example, but (empty) C-style for loops are! Leave those alone.

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 28, 2016 at 08:01:02PM +, Seb via Digitalmars-d wrote: > On Thursday, 28 April 2016 at 18:53:21 UTC, Steven Schveighoffer wrote: > >grrr... and they removed C-style for statements (i.e. for(;;)) > > > >-Steve > > I agree with the other people on this list - cleaning up a language

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Daniel Kozak via Digitalmars-d
Wierd, I am almost sure it does not work for me last time when I tried :) Dne 28.4.2016 v 22:54 Steven Schveighoffer via Digitalmars-d napsal(a): { int i = 0; while(i < 100) {...} }

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d
On 4/28/16 4:36 PM, Daniel Kozak via Digitalmars-d wrote: Dne 28.4.2016 v 22:20 Steven Schveighoffer via Digitalmars-d napsal(a): (BTW, swift doesn't allow arbitrary new scopes) And D does? Sure. { int i = 0; while(i < 100) {...} } // i no longer defined Won't work in swift.

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Daniel Kozak via Digitalmars-d
Dne 28.4.2016 v 22:20 Steven Schveighoffer via Digitalmars-d napsal(a): (BTW, swift doesn't allow arbitrary new scopes) And D does?

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d
On 4/28/16 4:01 PM, Seb wrote: On Thursday, 28 April 2016 at 18:53:21 UTC, Steven Schveighoffer wrote: grrr... and they removed C-style for statements (i.e. for(;;)) -Steve I agree with the other people on this list - cleaning up a language is great and should be done. `++` might be a bad

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Seb via Digitalmars-d
On Thursday, 28 April 2016 at 18:53:21 UTC, Steven Schveighoffer wrote: grrr... and they removed C-style for statements (i.e. for(;;)) -Steve I agree with the other people on this list - cleaning up a language is great and should be done. `++` might be a bad example, but (empty) C-style for

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Nick Treleaven via Digitalmars-d
On Thursday, 28 April 2016 at 19:45:47 UTC, Steven Schveighoffer wrote: If you don't want to mutate it, don't put var in the parameter name. I put var there because I wanted to mutate it. Swift requires that already. It just now won't let you do it in the parameter declaration, you have to

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d
On 4/28/16 3:39 PM, Nick Treleaven wrote: On Thursday, 28 April 2016 at 18:49:54 UTC, Steven Schveighoffer wrote: 1. Swift 3 will no longer allow mutable variables as parameters. Instead, your parameters will be immutable, or reference (inout). To fix this, you can assign your immutable

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d
On 4/28/16 3:21 PM, David Nadlinger wrote: On Thursday, 28 April 2016 at 18:49:54 UTC, Steven Schveighoffer wrote: Please, D, don't ever do this kind of stuff! I just gained about 45 warnings in my iOS project. … and what? This statement alone is hardly an argument. Both those warnings are

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Nick Treleaven via Digitalmars-d
On Thursday, 28 April 2016 at 18:49:54 UTC, Steven Schveighoffer wrote: 1. Swift 3 will no longer allow mutable variables as parameters. Instead, your parameters will be immutable, or reference (inout). To fix this, you can assign your immutable variable to a mutable one (immutability is

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Thiez via Digitalmars-d
On Thursday, 28 April 2016 at 18:49:54 UTC, Steven Schveighoffer wrote: var i = i (which you may think causes i to now be mutable, but in actuality declares a NEW variable to shadow the old). So how would you tell the difference, and why would you care? Swift uses LLVM, so everything gets

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread David Nadlinger via Digitalmars-d
On Thursday, 28 April 2016 at 18:49:54 UTC, Steven Schveighoffer wrote: Please, D, don't ever do this kind of stuff! I just gained about 45 warnings in my iOS project. … and what? This statement alone is hardly an argument. Both those warnings are trivial to fix in an automated fashion; in

Re: [OT] Swift removing minor features to piss me off

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d
grrr... and they removed C-style for statements (i.e. for(;;)) -Steve

[OT] Swift removing minor features to piss me off

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d
This is what bouncing the rubble looks like. 1. Swift 3 will no longer allow mutable variables as parameters. Instead, your parameters will be immutable, or reference (inout). To fix this, you can assign your immutable variable to a mutable one (immutability is always head immutability in