Jonathan M Davis:
arr.reverse.map!sqrt
Yes, but arguably, chaining calls in this case is bad,
We have discussed this some time... and I'd like reverse() to
return the original array (like the deprecated array .reverse
property). It's not a perfect design, but allowing UFCS chains is
qu
On Friday, January 30, 2015 10:46:54 Ali Çehreli via Digitalmars-d-learn wrote:
> On 01/30/2015 09:55 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
> > there is no such benefit with reverse, so there's no need to
> > return anything.
>
> Still, returning the original range would help with c
On Friday, 30 January 2015 at 18:46:55 UTC, Ali Çehreli wrote:
> there is no such benefit with reverse, so there's no need to
> return anything.
Still, returning the original range would help with chaining
calls:
arr.reverse.map!sqrt
Side note: There is the confusion between the .reverse p
On 01/30/2015 09:55 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
> sort returns a different type rather than the original type, and that
type
> indicates that its sorted, and some algoritms are able to take
advantage of
> that.
I covered that a little bit during DConf 2014, at around 4
On Friday, January 30, 2015 18:42:57 FG via Digitalmars-d-learn wrote:
> On 2015-01-30 at 17:07, Paul wrote:
> > writeln("Sorted, reversed: ", reverse(myVals));
> >
> > Gives me...
> >
> > Error: template std.stdio.writeln cannot deduce function from argument
> > types !()(string, void)
>
> As it
On 2015-01-30 at 18:42, FG wrote:
But you may wonder what the design choice behind that was that reverse doesn't
return the range itself while sort does (a SortedRange, specifically).
Although, after thinking about it, it makes sense. sort is used mostly to
enforce that something is sorted in
On 2015-01-30 at 17:07, Paul wrote:
writeln("Sorted, reversed: ", reverse(myVals));
Gives me...
Error: template std.stdio.writeln cannot deduce function from argument types
!()(string, void)
As it should, because reverse returns nothing, void.
But you may wonder what the design choice behind
On Friday, 30 January 2015 at 17:07:17 UTC, Paul wrote:
On Friday, 30 January 2015 at 16:21:24 UTC, Kagamin wrote:
writeln("Sorted, reversed: ", retro(sort(myVals)));
?
Or...
writeln("Reverse sorted: ", sort!("a > b")(vals));
but I still don't understand the original 'error'.
Take a look a
On Friday, 30 January 2015 at 16:21:24 UTC, Kagamin wrote:
writeln("Sorted, reversed: ", retro(sort(myVals)));
?
Or...
writeln("Reverse sorted: ", sort!("a > b")(vals));
but I still don't understand the original 'error'.
writeln("Sorted, reversed: ", retro(sort(myVals)));
?
Given that myVals is a dynamic array of ints...
writeln("Array contents: ", myVals);
writeln("Sorted: ", sort(myVals));
writeln("Sorted, reversed: ", reverse(myVals));
Gives me...
Error: template std.stdio.writeln cannot deduce function from
argument types !()(string, void)
But, if I bring t
11 matches
Mail list logo