Why is to(T) pure but roundTo(T) impure?

2012-06-09 Thread Chris Saunders
Hi -- I've been trying to learn more about D's purity features after reading David Nadlinger's interesting post on this topic. While 'purifying' some existing code I discovered that I can't use roundTo in a pure function, and I don't understand why. Is this a general problem with most floatin

Re: Why is to(T) pure but roundTo(T) impure?

2012-06-09 Thread Jonathan M Davis
On Saturday, June 09, 2012 20:43:42 Chris Saunders wrote: > Hi -- > > I've been trying to learn more about D's purity features after > reading David Nadlinger's interesting post on this topic. While > 'purifying' some existing code I discovered that I can't use > roundTo in a pure function, and I

Re: Why is to(T) pure but roundTo(T) impure?

2012-06-09 Thread Chris Saunders
On Saturday, 9 June 2012 at 19:33:55 UTC, Jonathan M Davis wrote: On Saturday, June 09, 2012 20:43:42 Chris Saunders wrote: Hi -- I've been trying to learn more about D's purity features after reading David Nadlinger's interesting post on this topic. While 'purifying' some existing code I disco

Re: Why is to(T) pure but roundTo(T) impure?

2012-06-09 Thread Jonathan M Davis
On Sunday, June 10, 2012 04:06:03 Chris Saunders wrote: > Thanks Jonathan. Sounds like a practical issue rather than some > theoretical problem -- good to know. The vast majority of purity issues with Phobos are purely an implementation issue and not any kind of limit in the language. Obviously s