Re: Purity with references and pointers

2010-09-20 Thread Kagamin
Jonathan M Davis Wrote: > If a pure function takes a reference/pointer, does that state that the result > of > the function will be the same on two calls to it if the reference/pointer > points > to the same data in both cases or if the data itself is unchanged? > > If it's a matter of pointi

Re: Purity with references and pointers

2010-09-20 Thread Don
Simen kjaeraas wrote: Jonathan M Davis wrote: Except that since when is anything implictly convertable to immutable? Implicitly converted to const, yes. That happens often enough, but immutable? Anything that does not contain pointers or references to non-immutable data is implicitly conver

Re: Purity with references and pointers

2010-09-18 Thread Simen kjaeraas
Jonathan M Davis wrote: Except that since when is anything implictly convertable to immutable? Implicitly converted to const, yes. That happens often enough, but immutable? Anything that does not contain pointers or references to non-immutable data is implicitly convertible to immutable, if

Re: Purity with references and pointers

2010-09-18 Thread Jonathan M Davis
On Saturday 18 September 2010 18:16:31 Jonathan M Davis wrote: > I don't think that *anything* > is implicitly convertable to immutable. const yes, but not immutable Actually, I guess that value types are implicitly convertible to immutable in the sense that you can create a new immutable value f

Re: Purity with references and pointers

2010-09-18 Thread Jonathan M Davis
On Saturday 18 September 2010 17:33:21 Simen kjaeraas wrote: > Jonathan M Davis wrote: > > If a pure function takes a reference/pointer, does that state that the > > result of > > the function will be the same on two calls to it if the > > reference/pointer points > > to the same data in both case

Re: Purity with references and pointers

2010-09-18 Thread Simen kjaeraas
Jonathan M Davis wrote: If a pure function takes a reference/pointer, does that state that the result of the function will be the same on two calls to it if the reference/pointer points to the same data in both cases or if the data itself is unchanged? If it's a matter of pointing to the s