On 10.06.2018 20:58, SrMordred wrote:
a => { return 2*a; }
/\ \ /
|| \ /
|| \ /
|| \ /
|| \ /
This is \ /
function \ This is definition of delegate
definition \
so you have a function that returns delegate.
```
it's like
a => a
a => { return 2*a; }
/\ \ /
|| \ /
||\ /
|| \ /
|| \ /
This is \ /
function \ This is definition of delegate
definition \
so you have a function that returns delegate.
```
it's like
a => a => 2*a;
or
(a){ return () { return
On 10.06.2018 12:21, OlegZ wrote:
On Saturday, 9 June 2018 at 22:28:22 UTC, Ali Çehreli wrote:
There is some explanation at the following page, of how the lambda
syntax is related to the full syntax:
http://ddili.org/ders/d.en/lambda.html#ix_lambda.=%3E
copy rect from article as image
http
On Saturday, 9 June 2018 at 22:28:22 UTC, Ali Çehreli wrote:
There is some explanation at the following page, of how the
lambda syntax is related to the full syntax:
http://ddili.org/ders/d.en/lambda.html#ix_lambda.=%3E
copy rect from article as image
https://i.gyazo.com/c23a9139688b7ed59fb
On 06/09/2018 02:09 PM, OlegZ wrote:
On Saturday, 9 June 2018 at 20:55:21 UTC, drug wrote:
In fact using `=>` you really define a function returning delegate.
I see. Thanks.
There is some explanation at the following page, of how the lambda
syntax is related to the full syntax:
http://dd
On Saturday, 9 June 2018 at 20:55:21 UTC, drug wrote:
In fact using `=>` you really define a function returning
delegate.
I see. Thanks.
On 09.06.2018 23:39, OlegZ wrote:
On Saturday, 9 June 2018 at 20:03:15 UTC, OlegZ wrote:
auto hz = (string s) => { writeln( s ); return cast( int )s.length; }
How I should to write lambda of type "int delegate( string )?
I found one way:
auto hz = delegate int( string s ) { writeln( s ); ret
On Saturday, 9 June 2018 at 20:03:15 UTC, OlegZ wrote:
auto hz = (string s) => { writeln( s ); return cast( int
)s.length; }
How I should to write lambda of type "int delegate( string )?
I found one way:
auto hz = delegate int( string s ) { writeln( s ); return cast(
int )s.length; };
but
I want "int delegate( string )", but hz most probably is "int
function( string )"
auto hz = (string s) => { writeln( s ); return cast( int
)s.length; };
but
pragma (msg, typeid( (string s) => { writeln( s ); return cast(
int )s.length; }));
shows
typeid( int delegate() @safe function(string s)