On Tuesday, September 13, 2016 20:08:22 Patrick Schluter via Digitalmars-d-
learn wrote:
> On Tuesday, 13 September 2016 at 06:59:10 UTC, Jonathan M Davis
>
> wrote:
> > On Tuesday, September 13, 2016 03:33:04 Ivy Encarnacion via
> >
> > Digitalmars-d- learn wrote:
> > A pure function cannot call
On 9/13/16 4:08 PM, Patrick Schluter wrote:
On Tuesday, 13 September 2016 at 06:59:10 UTC, Jonathan M Davis wrote:
On Tuesday, September 13, 2016 03:33:04 Ivy Encarnacion via
Digitalmars-d- learn wrote:
A pure function cannot call any function that is not pure [...]
I've read that a lot but
On Tuesday, 13 September 2016 at 06:59:10 UTC, Jonathan M Davis
wrote:
On Tuesday, September 13, 2016 03:33:04 Ivy Encarnacion via
Digitalmars-d- learn wrote:
A pure function cannot call any function that is not pure [...]
I've read that a lot but it's not true. A pure function can call
imp
On Tuesday, September 13, 2016 03:33:04 Ivy Encarnacion via Digitalmars-d-
learn wrote:
> Can pure functions throw exceptions on its arguments? Also, how
> can it perform impure operations?
Yes, as long as the exception's constructor is pure, a pure function can
throw an exception. However, whethe
On Tuesday, 13 September 2016 at 03:33:04 UTC, Ivy Encarnacion
wrote:
Can pure functions throw exceptions on its arguments?
You can throw exceptions for whatever reasons from a function
marked pure:
void foo() pure
{
throw new Exception("nope");
}
void main()
{
foo();
}
Al
On 23/05/12 11:41, bearophile wrote:
Simen Kjaeraas:
Should this be filed as a bug, or is the plan that only pure functions be
ctfe-able? (or has someone already filed it, perhaps)
It's already in Bugzilla, see issue 7994 and 6169.
It's just happening because the purity checking is currentl
Simen Kjaeraas:
Should this be filed as a bug, or is the plan that only pure
functions be
ctfe-able? (or has someone already filed it, perhaps)
It's already in Bugzilla, see issue 7994 and 6169.
But I think there is a semantic hole in some of the discussions
about this problem. Is a future
Namespace:
So only GDC optimized "pure" functions at all?
I've seen DMD performs some optimizations with "strongly pure"
functions that return integral values.
If you have code like:
int sqr(in int x) pure nothrow { return x * x; }
int y = ...
auto r = sqr(y) + sqr(y);
I think DMD replac
On Friday, 20 April 2012 at 09:55:28 UTC, Timon Gehr wrote:
On 04/20/2012 10:06 AM, Namespace wrote:
The sense of pure functions isn't clear to me.
What is the advantage of pure functions / methods?
1. It enables stateless reasoning about program parts.
2. It enables certain compiler optimizat
On 04/20/2012 10:06 AM, Namespace wrote:
The sense of pure functions isn't clear to me.
What is the advantage of pure functions / methods?
1. It enables stateless reasoning about program parts.
2. It enables certain compiler optimizations.
I inform the compiler with "const" that this method d
On 4/20/2012 3:06 AM, Namespace wrote:
The sense of pure functions isn't clear to me.
What is the advantage of pure functions / methods?
I inform the compiler with "const" that this method does not change the
current object, and therefore he can optimize (at least in C++) this
method. How and wha
On 4/20/12 4:06 PM, Namespace wrote:
The sense of pure functions isn't clear to me.
What is the advantage of pure functions / methods?
I inform the compiler with "const" that this method does not change the
current object, and therefore he can optimize (at least in C++) this
method. How and what
On 01/18/2012 04:40 AM, H. S. Teoh wrote:
So, I was quite impressed with D's pureness system, and was
experimenting a bit with it. Then I discovered that delegates are
impure, which seems reasonable since there's no way to know what a
delegate might do. But *if* the compiler verifies that a parti
13 matches
Mail list logo