Jesse Phillips jessekphillip...@gmail.com wrote in message
news:j5gfsa$2d5g$1...@digitalmars.com...
Thank you this lets it compile. I think I had that somewhere, but forgot
about it. As Steve mentions, it probably should also work for const
arguments too.
It probably will, eventually. Some
On Thu, 22 Sep 2011 22:18:29 +0100, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, September 22, 2011 14:10 Steven Schveighoffer wrote:
No, the parameter types can be const, and can accept mutable arguments.
The main point is, the return value has to be proven to be *unique*. The
The discussion on Reddit brought to my attention that pure functions can return
and assign to an immutable.
http://www.reddit.com/r/programming/comments/knn5p/thoughts_on_immutability_in_d/c2lsgek
I am trying to modify the example request to make use of this, but have failed.
On 22.09.2011 22:53, Jesse Phillips wrote:
The discussion on Reddit brought to my attention that pure functions can return
and assign to an immutable.
http://www.reddit.com/r/programming/comments/knn5p/thoughts_on_immutability_in_d/c2lsgek
I am trying to modify the example request to make use
On Thursday, September 22, 2011 23:36:40 Dmitry Olshansky wrote:
On 22.09.2011 22:53, Jesse Phillips wrote:
The discussion on Reddit brought to my attention that pure functions can
return and assign to an immutable.
http://www.reddit.com/r/programming/comments/knn5p/thoughts_on_immutabil
On Thu, 22 Sep 2011 15:44:21 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, September 22, 2011 23:36:40 Dmitry Olshansky wrote:
On 22.09.2011 22:53, Jesse Phillips wrote:
The discussion on Reddit brought to my attention that pure functions
can
return and assign to an
On Thu, 22 Sep 2011 16:09:29 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Thu, 22 Sep 2011 15:44:21 -0400, Jonathan M Davis
jmdavisp...@gmx.com wrote:
On Thursday, September 22, 2011 23:36:40 Dmitry Olshansky wrote:
On 22.09.2011 22:53, Jesse Phillips wrote:
The discussion
On Thursday, September 22, 2011 16:09:29 Steven Schveighoffer wrote:
On Thu, 22 Sep 2011 15:44:21 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, September 22, 2011 23:36:40 Dmitry Olshansky wrote:
On 22.09.2011 22:53, Jesse Phillips wrote:
The discussion on Reddit
On Thursday, September 22, 2011 16:11:05 Steven Schveighoffer wrote:
On Thu, 22 Sep 2011 16:09:29 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Thu, 22 Sep 2011 15:44:21 -0400, Jonathan M Davis
jmdavisp...@gmx.com wrote:
On Thursday, September 22, 2011 23:36:40 Dmitry
On Thu, 22 Sep 2011 16:15:20 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, September 22, 2011 16:09:29 Steven Schveighoffer wrote:
Technically, something like this could be cast to immutable:
T[] foo(const(T)[] arg) pure
Since it can be proven that the result is new
On Thu, 22 Sep 2011 16:23:12 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, September 22, 2011 16:11:05 Steven Schveighoffer wrote:
On Thu, 22 Sep 2011 16:09:29 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Thu, 22 Sep 2011 15:44:21 -0400, Jonathan M Davis
On Thursday, September 22, 2011 13:25 Steven Schveighoffer wrote:
On Thu, 22 Sep 2011 16:15:20 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, September 22, 2011 16:09:29 Steven Schveighoffer wrote:
Technically, something like this could be cast to immutable:
T[]
On Thursday, September 22, 2011 14:03 Jonathan M Davis wrote:
In any case, in order for a function to be able to have its return value
implicitly value implicitly cast to immutable, it must pure and all of its
arguments must be immutable[...]
Ouch! I really must reread my posts more before
On Thursday, September 22, 2011 14:10 Steven Schveighoffer wrote:
On Thu, 22 Sep 2011 17:03:08 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
In any case, in order for a function to be able to have its return value
implicitly value implicitly cast to immutable, it must pure and all of
Dmitry Olshansky Wrote:
Maybe:
-
List!T makeFromArray(T)(immutable T[] array) pure {
--
Dmitry Olshansky
Thank you this lets it compile. I think I had that somewhere, but forgot about
it. As Steve mentions, it probably should also work for const arguments too.
Jesse Phillips:
Thank you this lets it compile. I think I had that somewhere, but forgot
about it. As Steve mentions, it probably should also work for const arguments
too.
If you are convinced of this, then I suggest you to add an enhancement request
in Phobos about it. It will make purity
16 matches
Mail list logo