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
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
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!
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
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?
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
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
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
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
On 29.04.2016 08:23, Jacob Carlborg wrote:
foreach (i; 0 .. 5)
Yeah, but that's special syntax, not a range.
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
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
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.
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
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
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
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,
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
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.
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
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 ++
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
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
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...
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!
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
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?
//
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.
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
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) {...}
}
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.
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?
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
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
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
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
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
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
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
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
grrr... and they removed C-style for statements (i.e. for(;;))
-Steve
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
42 matches
Mail list logo