Kai Meyer:
> minCount is, or the usage of minCount in his particular problem?
Your usage seems OK. What I meant is that I don't like the design of
min/max/minCount. I have expressed my ideas here:
http://d.puremagic.com/issues/show_bug.cgi?id=4705
I'd like to know what Andrei thinks about it. Th
On 08/04/2011 07:54 PM, bearophile wrote:
Kai Meyer:
Looking at std.algorithm, I think what you really want is minCount:
http://www.d-programming-language.org/phobos/std_algorithm.html#minCount
It's a bad design.
Bye,
bearophile
minCount is, or the usage of minCount in his particular probl
Kai Meyer:
> Looking at std.algorithm, I think what you really want is minCount:
> http://www.d-programming-language.org/phobos/std_algorithm.html#minCount
It's a bad design.
Bye,
bearophile
Cool. I've submitted a bug report for this, but maybe it's a duplicate.
Andrei Mitrovic wrote:
> Does anyone know why putting this alias in module scope errors out?:
>
> import std.algorithm;
>
> alias reduce!((a, b){ return 1; }) foo;
>
> void main()
> {
> foo([1, 2, 3]);
> }
>
> Error: delegate test.__dgliteral1!(int,int).__dgliteral1 is a nested
> function and c
On 08/02/2011 06:03 AM, Andrej Mitrovic wrote:
import std.algorithm;
void main()
{
auto x = min([1, 2, 3]); // x would be 1
}
min() isn't equipped to do this on a single range. What can I use
instead? I haven't had my coffee yet. :)
Looking at std.algorithm, I think what you really want
Andrej Mitrovic:
> import std.algorithm;
>
> void main()
> {
> auto x = min([1, 2, 3]); // x would be 1
> }
>
> min() isn't equipped to do this on a single range. What can I use
> instead? I haven't had my coffee yet. :)
See:
http://d.puremagic.com/issues/show_bug.cgi?id=4705
Bye,
bearoph
On 02.08.2011 14:42, Andrej Mitrovic wrote:
Oh just realized I can use the much simpler:
auto x = reduce!(min)([1, 2, 3]);
Coffee is starting to kick in!
Of course. I even had a lot of coffee running through my veins, so shame
on me!
Oh just realized I can use the much simpler:
auto x = reduce!(min)([1, 2, 3]);
Coffee is starting to kick in!
Does anyone know why putting this alias in module scope errors out?:
import std.algorithm;
alias reduce!((a, b){ return 1; }) foo;
void main()
{
foo([1, 2, 3]);
}
Error: delegate test.__dgliteral1!(int,int).__dgliteral1 is a nested
function and cannot
be accessed from reduce
But this will
On 8/2/11, simendsjo wrote:
> assert(reduce!"min(a,b)"([1,2,3]) == 1);
Thanks!
On 02.08.2011 14:03, Andrej Mitrovic wrote:
import std.algorithm;
void main()
{
auto x = min([1, 2, 3]); // x would be 1
}
min() isn't equipped to do this on a single range. What can I use
instead? I haven't had my coffee yet. :)
import std.algorithm;
void main() {
assert(min(1, 2,
import std.algorithm;
void main()
{
auto x = min([1, 2, 3]); // x would be 1
}
min() isn't equipped to do this on a single range. What can I use
instead? I haven't had my coffee yet. :)
13 matches
Mail list logo