Re: What is @return?

2015-01-29 Thread FG via Digitalmars-d-learn


@property auto info() @safe @nothrow @pure @return const { return this; }

It is mesmerizing...   (@ _ @)


Re: What is @return?

2015-01-29 Thread Jesse Phillips via Digitalmars-d-learn

On Thursday, 29 January 2015 at 05:02:58 UTC, ketmar wrote:

http://wiki.dlang.org/DIP25
this is a very recent thing, it wasn't coded when 2.066 was 
released.


Thanks, I like it.


Re: What is @return?

2015-01-29 Thread Benjamin Thaut via Digitalmars-d-learn

On Thursday, 29 January 2015 at 11:50:29 UTC, FG wrote:


@property auto info() @safe @nothrow @pure @return const { 
return this; }


It is mesmerizing...   (@ _ @)


And soon its gong to look like this:

export @property auto info() @safe @nothrow @pure @return const { 
return this; }


What is @return?

2015-01-28 Thread Jesse Phillips via Digitalmars-d-learn

A recent discussion over in digitalmars.D
http://forum.dlang.org/post/rtwbtxigfeupvykpb...@forum.dlang.org

talks about accepting @return... Here is an example from the PR:
https://github.com/D-Programming-Language/dmd/compare/366422338ece...6b86b12f79e8

struct At
{
 @property auto info() @safe @nothrow @pure @return const { 
return this; }


 @pure @nothrow @return ref int info2(ref int x) { return x; }
}

Which I assume before the change would be:

struct At
{
 @property auto info() @safe nothrow pure return const { return 
this; }


 pure nothrow return ref int info2(ref int x) { return x; }
}

I don't know about anyone else, but this doesn't compile in 2.066.


Re: What is @return?

2015-01-28 Thread ketmar via Digitalmars-d-learn
On Thu, 29 Jan 2015 04:54:38 +, Jesse Phillips wrote:

 A recent discussion over in digitalmars.D
 http://forum.dlang.org/post/rtwbtxigfeupvykpb...@forum.dlang.org
 
 talks about accepting @return... Here is an example from the PR:
 https://github.com/D-Programming-Language/dmd/
compare/366422338ece...6b86b12f79e8
 
 struct At {
   @property auto info() @safe @nothrow @pure @return const {
 return this; }
 
   @pure @nothrow @return ref int info2(ref int x) { return x; }
 }
 
 Which I assume before the change would be:
 
 struct At {
   @property auto info() @safe nothrow pure return const { return
 this; }
 
   pure nothrow return ref int info2(ref int x) { return x; }
 }
 
 I don't know about anyone else, but this doesn't compile in 2.066.

http://wiki.dlang.org/DIP25
this is a very recent thing, it wasn't coded when 2.066 was released.

signature.asc
Description: PGP signature


Re: What is @return?

2015-01-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, January 29, 2015 05:02:58 ketmar via Digitalmars-d-learn wrote:
 http://wiki.dlang.org/DIP25
 this is a very recent thing, it wasn't coded when 2.066 was released.

I don't know if it's even fully coded up in git master, though clearly it's
at least partially there, because @ was put on return as part of the PR that
triggered that discussion. Regardless, it's _very_ new (IIRC, it's been less
than a month since it was approved).

- Jonathan M Davis