Jump to page: 1 214  
Page
Thread overview
A nice way to step into 2012
Dec 27, 2011
Masahiro Nakagawa
Dec 27, 2011
Nick Sabalausky
Dec 27, 2011
Long Chang
Dec 27, 2011
Jacob Carlborg
Dec 27, 2011
Jakob Ovrum
Dec 27, 2011
bearophile
Dec 27, 2011
deadalnix
Dec 27, 2011
Peter Alexander
Dec 27, 2011
Jakob Ovrum
Dec 28, 2011
Jonathan M Davis
Dec 28, 2011
foobar
Dec 27, 2011
dsimcha
Dec 27, 2011
dsimcha
Dec 27, 2011
Walter Bright
Dec 27, 2011
Walter Bright
Dec 27, 2011
so
Dec 27, 2011
Walter Bright
Dec 28, 2011
Marco Leise
Dec 27, 2011
Walter Bright
Dec 27, 2011
Nick Sabalausky
Dec 27, 2011
Andrej Mitrovic
Dec 28, 2011
Jonathan M Davis
Dec 28, 2011
Marco Leise
Dec 28, 2011
Andrej Mitrovic
Dec 28, 2011
Peter Alexander
Dec 28, 2011
Jacob Carlborg
Dec 28, 2011
Jacob Carlborg
Dec 28, 2011
Jonathan M Davis
Dec 28, 2011
Timon Gehr
Dec 28, 2011
Jonathan M Davis
Dec 28, 2011
Timon Gehr
Dec 28, 2011
so
Dec 28, 2011
Timon Gehr
Dec 28, 2011
so
Dec 28, 2011
Timon Gehr
Dec 28, 2011
bearophile
Dec 28, 2011
so
Dec 29, 2011
so
Dec 29, 2011
Timon Gehr
Dec 29, 2011
so
Dec 29, 2011
Derek
Dec 29, 2011
Timon Gehr
Dec 29, 2011
Don
Dec 29, 2011
Derek
Dec 29, 2011
Don
Dec 29, 2011
Mehrdad
Dec 29, 2011
Derek
Dec 30, 2011
Don
Dec 30, 2011
Derek
Dec 30, 2011
Manfred Nowak
Dec 31, 2011
Don
Dec 31, 2011
so
Dec 31, 2011
Don
Dec 31, 2011
Timon Gehr
Jan 01, 2012
Don
Jan 01, 2012
Timon Gehr
Named Parameters (Was: A nice way to step into 2012)
Dec 29, 2011
Derek
Dec 29, 2011
Timon Gehr
Dec 29, 2011
bearophile
Dec 29, 2011
Timon Gehr
Dec 29, 2011
bearophile
Dec 29, 2011
David Nadlinger
Dec 29, 2011
Don
Dec 29, 2011
Gor Gyolchanyan
Dec 29, 2011
Derek
Dec 29, 2011
Don
Dec 29, 2011
so
Dec 29, 2011
Jonathan M Davis
Dec 31, 2011
so
Dec 31, 2011
Don
Dec 28, 2011
Adam D. Ruppe
Dec 28, 2011
bearophile
Dec 28, 2011
Jacob Carlborg
Dec 27, 2011
Joshua Reusch
Dec 27, 2011
Torarin
compiling dmd
Dec 27, 2011
Trass3r
Dec 27, 2011
Walter Bright
Dec 27, 2011
Joshua Reusch
Dec 27, 2011
Walter Bright
Dec 27, 2011
Walter Bright
Dec 28, 2011
Peter Alexander
Dec 28, 2011
Timon Gehr
Dec 29, 2011
Don
Dec 31, 2011
Marco Leise
Jan 01, 2012
Don
Dec 27, 2011
Jacob Carlborg
Dec 27, 2011
Timon Gehr
Dec 28, 2011
Jacob Carlborg
Dec 28, 2011
Jacob Carlborg
Dec 27, 2011
Timon Gehr
Dec 27, 2011
Timon Gehr
Dec 28, 2011
bearophile
Dec 28, 2011
Jacob Carlborg
Dec 28, 2011
Timon Gehr
Dec 28, 2011
Jacob Carlborg
Dec 28, 2011
deadalnix
Dec 28, 2011
Max Samukha
Dec 28, 2011
Jacob Carlborg
Dec 28, 2011
Jacob Carlborg
Dec 28, 2011
bearophile
Dec 28, 2011
Adam D. Ruppe
Dec 29, 2011
Max Samukha
Dec 29, 2011
Jacob Carlborg
Dec 29, 2011
Adam D. Ruppe
Dec 27, 2011
bearophile
Dec 28, 2011
Jacob Carlborg
Dec 29, 2011
Don
Dec 29, 2011
Jacob Carlborg
Dec 29, 2011
bearophile
Dec 30, 2011
Timon Gehr
Dec 31, 2011
Don
Dec 31, 2011
Timon Gehr
Jan 01, 2012
Don
Jan 01, 2012
Timon Gehr
December 27, 2011
https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc

Andrei
December 27, 2011
On Tuesday, 27 December 2011 at 04:25:00 UTC, Andrei Alexandrescu wrote:
> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>
> Andrei

This change is cooooool!


Masahiro
December 27, 2011
"Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message news:jdbhas$2ftb$1@digitalmars.com...
> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>
> Andrei

Fanfuckingtastic!


December 27, 2011
Lambda very cooooool!

I hope we can add shared lib support for linux & freebsd in 2012.


On 27 December 2011 12:25, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>
> Andrei
December 27, 2011
On Tuesday, 27 December 2011 at 04:25:00 UTC, Andrei Alexandrescu wrote:
> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>
> Andrei

Finally, it's here! I'll be able to use std.algorithm stuff without tons of named, nested functions now :)
December 27, 2011
Andrei Alexandrescu:

> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc

Since some time thanks to a post in this newsgroups I am able to compile DMD, so I am able to test the changes early. It seems to work in various situations:


import std.stdio, std.range, std.algorithm;
int foo(alias callMe)(int a) {
    return callMe(a);
}
int bar(alias callMe)() {
    return callMe(1, 10, 100);
}
void main() {
    auto r = foo!((x) => x ^^ 2)(4);
    assert(r == 16);
    r = foo!((x,) => x ^^ 2)(5);
    assert(r == 25);
    // r = foo!((x,,) => x ^^ 2)(5); // error, good
    r = foo!(x=>x^^2)(6);
    assert(r == 36);
    r = bar!((x, y, z) => x + y + z)();
    assert(r == 111);
    double delegate(double)[] f;
    f ~= (double x) => x ^^ 2;
    assert(f[0](10) == 100);
    // Syntax variety, fit for everyone:
    auto pow4 = (int x) => x ^^ 4;
    writeln(map!(function int(in int x) pure nothrow { return x ^^ 4; })(iota(10)));
    writeln(map!(function int(int x){ return x ^^ 4; })(iota(10)));
    writeln(map!(function(int x){ return x ^^ 4; })(iota(10)));
    writeln(map!((int x){ return x ^^ 4; })(iota(10)));
    writeln(map!((x){ return x ^^ 4; })(iota(10)));
    writeln(map!((int x) => x ^^ 4)(iota(10)));
    writeln(map!((x) => x ^^ 4)(iota(10)));
    writeln(map!(x => x ^^ 4)(iota(10)));
    writeln(map!q{ a ^^ 4 }(iota(10)));
    writeln(map!"a^^4"(iota(10)));
    writeln(map!pow4(iota(10)));
}

-----------------------

This program contains wrong syntax because x lacks a type:

void main() {
    double delegate(double) f;
    f = (x) => x + 1;
}


DMD gives the error messages:

test.d(3): Error: undefined identifier x, did you mean variable f?
test.d(3): Error: cannot implicitly convert expression (__dgliteral1) of type _error_ delegate(_error_) to double delegate(double)

Is it wise to try to improve the second error message?

Bye,
bearophile
December 27, 2011
Le 27/12/2011 05:25, Andrei Alexandrescu a écrit :
> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>
>
> Andrei

Maybe I'll seem bitter, but I do not think this changement was really that important. This is nice, ok, but we have some other really serious flaw, like shared not doing what it is supposed to do.
December 27, 2011
On 27/12/11 10:51 AM, deadalnix wrote:
> Le 27/12/2011 05:25, Andrei Alexandrescu a écrit :
>> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>>
>>
>>
>> Andrei
>
> Maybe I'll seem bitter, but I do not think this changement was really
> that important. This is nice, ok, but we have some other really serious
> flaw, like shared not doing what it is supposed to do.

You seem bitter :-)

Seriously though, it's a fair point, but the syntax of lambdas is fairly important and this appears to be a simple change so the cost/benefit ratio is particularly high in this case.
December 27, 2011
On Tuesday, 27 December 2011 at 10:57:35 UTC, Peter Alexander wrote:
> On 27/12/11 10:51 AM, deadalnix wrote:
>> Le 27/12/2011 05:25, Andrei Alexandrescu a écrit :
>>> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>>>
>>>
>>>
>>> Andrei
>>
>> Maybe I'll seem bitter, but I do not think this changement was really
>> that important. This is nice, ok, but we have some other really serious
>> flaw, like shared not doing what it is supposed to do.
>
> You seem bitter :-)
>
> Seriously though, it's a fair point, but the syntax of lambdas is fairly important and this appears to be a simple change so the cost/benefit ratio is particularly high in this case.

This. You can let people play around with it, test it and provide feedback with just a small patch.

And it is indeed very important. It's one of the few syntax woes we have to deal with in D, it would be a shame to let the benefits of std.algorithm and any other functional D code be overshadowed by the powerful but often excessive syntax of anonymous functions.

It's important when presenting D to initiates that high-level code looks nice.
December 27, 2011
On 27-12-2011 11:51, deadalnix wrote:
> Le 27/12/2011 05:25, Andrei Alexandrescu a écrit :
>> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>>
>>
>>
>> Andrei
>
> Maybe I'll seem bitter, but I do not think this changement was really
> that important. This is nice, ok, but we have some other really serious
> flaw, like shared not doing what it is supposed to do.

I don't quite agree. Short lambda syntax is *extremely important* for lambdas to actually be useful. If lambda syntax is not short and concise, it's not worth using over, say, a plain foreach loop.

I greatly welcome this change.

- Alex
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11