Jump to page: 1 214  
Page
Thread overview
dmd 2.029 release
Apr 20, 2009
Walter Bright
Apr 20, 2009
Simen Kjaeraas
Apr 20, 2009
BCS
Apr 20, 2009
bearophile
Apr 20, 2009
Walter Bright
Apr 20, 2009
bearophile
Apr 20, 2009
bearophile
Apr 20, 2009
Walter Bright
Apr 20, 2009
Walter Bright
Apr 20, 2009
tama
Apr 20, 2009
bearophile
Apr 20, 2009
tama
Apr 20, 2009
Denis Koroskin
Apr 20, 2009
tama
Apr 20, 2009
Walter Bright
Apr 20, 2009
Russell Lewis
Apr 20, 2009
bearophile
Apr 20, 2009
bearophile
Apr 20, 2009
BCS
Apr 20, 2009
Nick Sabalausky
Apr 20, 2009
BCS
Apr 21, 2009
Nick Sabalausky
Format specs idea
Apr 21, 2009
Georg Wrede
Apr 21, 2009
Russell Lewis
Apr 22, 2009
Lutger
Apr 20, 2009
Nick Sabalausky
Apr 27, 2009
renoX
Apr 27, 2009
Nick Sabalausky
Apr 27, 2009
renoX
Apr 20, 2009
Daniel Keep
Apr 20, 2009
Daniel Keep
Apr 20, 2009
Georg Wrede
Apr 20, 2009
Saaa
Apr 20, 2009
Georg Wrede
Apr 20, 2009
Georg Wrede
Apr 20, 2009
dsimcha
Apr 20, 2009
dsimcha
Apr 20, 2009
Walter Bright
Apr 20, 2009
Walter Bright
Apr 20, 2009
Walter Bright
Apr 20, 2009
Craig Black
Apr 20, 2009
superdan
Apr 20, 2009
downs
Apr 21, 2009
Georg Wrede
Apr 21, 2009
Leandro Lucarella
Apr 20, 2009
Georg Wrede
Apr 20, 2009
Russell Lewis
where's fwritefln? Re: dmd 2.029 release
Apr 20, 2009
annoyed
Apr 20, 2009
Tyro[a.c.edwards]
Apr 21, 2009
Stewart Gordon
Apr 21, 2009
Walter Bright
Apr 21, 2009
BCS
Apr 21, 2009
Walter Bright
Apr 21, 2009
Stewart Gordon
Apr 27, 2009
Walter Bright
Apr 27, 2009
Sean Kelly
Apr 21, 2009
Max Samukha
Apr 21, 2009
Max Samukha
Apr 22, 2009
Max Samukha
Apr 22, 2009
Brad Roberts
Apr 22, 2009
Max Samukha
Apr 21, 2009
Frits van Bommel
Apr 21, 2009
Daniel Keep
Apr 21, 2009
Frits van Bommel
Apr 21, 2009
Lutger
Apr 21, 2009
Don
Apr 21, 2009
Lutger
Apr 21, 2009
Walter Bright
Apr 21, 2009
Georg Wrede
Apr 22, 2009
Don
Apr 22, 2009
Georg Wrede
Apr 22, 2009
Don
Apr 23, 2009
Georg Wrede
Apr 23, 2009
Charles Hixson
Apr 22, 2009
Sean Kelly
Apr 27, 2009
Walter Bright
Apr 22, 2009
Leandro Lucarella
Apr 27, 2009
Walter Bright
Apr 27, 2009
Walter Bright
Apr 27, 2009
Christopher Wright
Apr 28, 2009
Georg Wrede
Apr 29, 2009
Walter Bright
Apr 21, 2009
Leandro Lucarella
Apr 21, 2009
Lutger
Apr 21, 2009
Don
Apr 21, 2009
bearophile
Apr 21, 2009
bearophile
Apr 21, 2009
bearophile
Apr 21, 2009
Don
Apr 21, 2009
Don
Apr 21, 2009
bearophile
Apr 21, 2009
Don
Apr 22, 2009
Don
Apr 22, 2009
bearophile
Apr 22, 2009
bearophile
Apr 23, 2009
Don
Apr 23, 2009
bearophile
Apr 23, 2009
Don
Apr 26, 2009
Don
Apr 22, 2009
Michel Fortin
Apr 22, 2009
Daniel Keep
Apr 22, 2009
Don
Apr 22, 2009
Don
Apr 21, 2009
Don
Apr 21, 2009
tama
Apr 23, 2009
Masahiro Nakagawa
Apr 23, 2009
Masahiro Nakagawa
Apr 23, 2009
Masahiro Nakagawa
April 20, 2009
This is a major revision to Phobos, including Andrei's revolutionary new range support.

http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.029.zip
April 20, 2009
On Mon, 20 Apr 2009 09:09:09 +0200, Walter Bright <newshound1@digitalmars.com> wrote:

>
> This is a major revision to Phobos, including Andrei's revolutionary new range support.
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.029.zip

Butbutbut... I've just barely managed to install 2.028 yet.

Great work! Can't wait to try out the new ranges.

--
Simen
April 20, 2009
Hello Walter,

> This is a major revision to Phobos, including Andrei's revolutionary
> new range support.
> 
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.029.zip

Cool template function literals sounds interesting


April 20, 2009
BCS Wrote:
> Cool template function literals sounds interesting

May I have one example of them?
I am looking in the docs, but I am not finding anything...

Bye,
bearophile
April 20, 2009
bearophile wrote:
> BCS Wrote:
>> Cool template function literals sounds interesting
> 
> May I have one example of them?
> I am looking in the docs, but I am not finding anything...

void foo(alias f)()
{
    f(3, 4);
}

foo!((x,y){return x * y;))();
April 20, 2009

bearophile wrote:
> BCS Wrote:
>> Cool template function literals sounds interesting
> 
> May I have one example of them?
> I am looking in the docs, but I am not finding anything...
> 
> Bye,
> bearophile

If I had to guess, I'd say it was something like this:

> alias (T)(T a, T b) { return (a+b)/2.0; } average;

Haven't had a chance to TRY that yet, mind you.  :P

  -- Daniel
April 20, 2009

Daniel Keep wrote:
> 
> bearophile wrote:
>> BCS Wrote:
>>> Cool template function literals sounds interesting
>> May I have one example of them?
>> I am looking in the docs, but I am not finding anything...
>>
>> Bye,
>> bearophile
> 
> If I had to guess, I'd say it was something like this:
> 
>> alias (T)(T a, T b) { return (a+b)/2.0; } average;
> 
> Haven't had a chance to TRY that yet, mind you.  :P
> 
>   -- Daniel

(Sees Walter's post)

Guess not.  :P

  -- Daniel
April 20, 2009
Walter Bright wrote:
> 
> This is a major revision to Phobos, including Andrei's revolutionary new range support.
> 
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.029.zip

Ooohhh, just half way through the change log, and already breathless!!!

April 20, 2009
Walter Bright:
> void foo(alias f)()
> {
>      f(3, 4);
> }
> foo!((x,y){return x * y;))();

I have tried:

import std.stdio: writeln;
void foo(alias f)() {
    f(3, 4);
}
void main() {
    foo!( (x, y) { writeln(x * y); } )();
}

And it works, printing 12 :-) Very cute.
This is able to simplify some of the code of (D1) dlibs :-)

I didn't even know that lambda delegates in D2 can now infer the type of their input argument, so you can use (x, y) instead of (int x, int y). Can you tell me when this was changed? :-)

Bye,
bearophile
April 20, 2009
In D1 I have written a very hairy (but not too much long) apply() function, that given a function and some arguments, returns the result of the function applied to them. (apply() is a basic higher-order thing common in most functional languages).

So now I'm playing with this new toy of D2, not using it in a serious way yet, and I have written:

import std.stdio: writeln;
auto apply(alias f, TyArgs...)(TyArgs args) {
    return f(args);
}
void main() {
    writeln(  apply!( (x, y) { return x * y; } )(3, 4)  );
}

But when I compile it the compile spits out at compile-time: Assertion failure: '0' on line 935 in file 'glue.c'

Bye,
bearophile
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11