Pure functions and pointers (yes, again)

2012-07-04 Thread Denis Shelomovskij
Since issue 8185 has been closed, I'm still very confused. I just understood that endless discussion doesn't result in anything. See example from http://d.puremagic.com/issues/show_bug.cgi?id=8185#c40 --- int f(size_t p) pure { return *cast(int*) p; } void g(size_t p, ref size_t) pure {

Re: Pure functions and pointers (yes, again)

2012-07-04 Thread Jonathan M Davis
On Wednesday, July 04, 2012 11:59:10 Denis Shelomovskij wrote: Since issue 8185 has been closed, I'm still very confused. I just understood that endless discussion doesn't result in anything. See example from http://d.puremagic.com/issues/show_bug.cgi?id=8185#c40 --- int f(size_t p) pure {

Re: Pure functions and pointers (yes, again)

2012-07-04 Thread Christophe Travert
Denis Shelomovskij , dans le message (digitalmars.D:171072), a écrit : Since issue 8185 has been closed, I'm still very confused. I just understood that endless discussion doesn't result in anything. See example from http://d.puremagic.com/issues/show_bug.cgi?id=8185#c40 --- int f(size_t

Re: Pure functions and pointers (yes, again)

2012-07-04 Thread Jonathan M Davis
On Wednesday, July 04, 2012 09:21:35 Christophe Travert wrote: What change would you expect in the langage? making pure function automatically @safe? That may not be such a ba idea. However, that is not even enough, you could still create bug from optimizations with casting outside the pure