Re: Calling dynamically bound functions from weakly pure function

2014-07-22 Thread via Digitalmars-d-learn
On Tuesday, 22 July 2014 at 13:35:27 UTC, Rene Zwanenburg wrote: On Saturday, 19 July 2014 at 11:12:00 UTC, Marc Schütz wrote: Casting to pure would break purity if the called function is not actually pure. AFAIU, the problem is that the mutable function pointers are not accessible from inside

Re: Calling dynamically bound functions from weakly pure function

2014-07-22 Thread Rene Zwanenburg via Digitalmars-d-learn
On Saturday, 19 July 2014 at 11:12:00 UTC, Marc Schütz wrote: Casting to pure would break purity if the called function is not actually pure. AFAIU, the problem is that the mutable function pointers are not accessible from inside the pure function at all, in which case the solution is to cast t

Re: Calling dynamically bound functions from weakly pure function

2014-07-19 Thread Kagamin via Digitalmars-d-learn
Broken purity deduction is less critical than broken purity check. We can hit the latter somewhere else.

Re: Calling dynamically bound functions from weakly pure function

2014-07-19 Thread Timon Gehr via Digitalmars-d-learn
On 07/19/2014 03:53 PM, Kagamin wrote: It's ok to deduce opDispatch as pure, but then its purity should be enforced and error reported. Why would it be ok to deduce opDispatch as pure only to report an error that it is not actually pure? This would be a bug as well (albeit none that causes un

Re: Calling dynamically bound functions from weakly pure function

2014-07-19 Thread Kagamin via Digitalmars-d-learn
It's ok to deduce opDispatch as pure, but then its purity should be enforced and error reported.

Re: Calling dynamically bound functions from weakly pure function

2014-07-19 Thread via Digitalmars-d-learn
On Friday, 18 July 2014 at 16:19:20 UTC, John Colvin wrote: On Friday, 18 July 2014 at 16:12:18 UTC, Rene Zwanenburg wrote: On Friday, 18 July 2014 at 15:57:40 UTC, John Colvin wrote: On Friday, 18 July 2014 at 14:15:46 UTC, Rene Zwanenburg wrote: For all intents and purposes, the following cod

Re: Calling dynamically bound functions from weakly pure function

2014-07-18 Thread John Colvin via Digitalmars-d-learn
On Friday, 18 July 2014 at 16:12:18 UTC, Rene Zwanenburg wrote: On Friday, 18 July 2014 at 15:57:40 UTC, John Colvin wrote: On Friday, 18 July 2014 at 14:15:46 UTC, Rene Zwanenburg wrote: For all intents and purposes, the following code can be weakly pure: struct VAO { } urrmm. Did you mea

Re: Calling dynamically bound functions from weakly pure function

2014-07-18 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 18 July 2014 at 15:57:40 UTC, John Colvin wrote: On Friday, 18 July 2014 at 14:15:46 UTC, Rene Zwanenburg wrote: For all intents and purposes, the following code can be weakly pure: struct VAO { } urrmm. Did you mean to post more than that? Haha yup. Not sure what happened ther

Re: Calling dynamically bound functions from weakly pure function

2014-07-18 Thread John Colvin via Digitalmars-d-learn
On Friday, 18 July 2014 at 14:15:46 UTC, Rene Zwanenburg wrote: For all intents and purposes, the following code can be weakly pure: struct VAO { } urrmm. Did you mean to post more than that?