Re: const and immutable objects

2009-09-01 Thread Graham St Jack
On Mon, 31 Aug 2009 15:20:21 -0500, Andrei Alexandrescu wrote: > Graham St Jack wrote: >> I have been trying (again) to start using const and immutable objects >> in a project, and found I kept getting stuck with the need to change >> the value of object references, which i

Re: const and immutable objects

2009-09-01 Thread Andrei Alexandrescu
Graham St Jack wrote: I have been trying (again) to start using const and immutable objects in a project, and found I kept getting stuck with the need to change the value of object references, which isn't allowed. I don't quite follow the arguments that mean that this has to be the

Re: const and immutable objects

2009-08-31 Thread Graham St Jack
On Mon, 31 Aug 2009 09:12:33 -0400, Steven Schveighoffer wrote: > On Sun, 30 Aug 2009 18:31:33 -0400, Graham St Jack > wrote: > >> I have been trying (again) to start using const and immutable objects >> in a project, and found I kept getting stuck with the need to change &

Re: const and immutable objects

2009-08-31 Thread Andrei Alexandrescu
Jeremie Pelletier wrote: Andrei Alexandrescu Wrote: Jeremie Pelletier wrote: Graham St Jack Wrote: On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: I agree that D lacks a mechanism to separate the object from it's reference. Maybe syntax like the following could be used to ap

Re: const and immutable objects

2009-08-31 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Graham St Jack Wrote: > > > >> On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: > >> > >> > >>> I agree that D lacks a mechanism to separate the object from it's > >>> reference. Maybe syntax like the following could be used

Re: const and immutable objects

2009-08-31 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Graham St Jack Wrote: > > > >> On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: > >> > >> > >>> I agree that D lacks a mechanism to separate the object from it's > >>> reference. Maybe syntax like the following could be used

Re: const and immutable objects

2009-08-31 Thread Andrei Alexandrescu
Jeremie Pelletier wrote: Graham St Jack Wrote: On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: I agree that D lacks a mechanism to separate the object from it's reference. Maybe syntax like the following could be used to apply the storage class to the object value, and not the

Re: const and immutable objects

2009-08-31 Thread Jeremie Pelletier
Graham St Jack Wrote: > On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: > > > > I agree that D lacks a mechanism to separate the object from it's > > reference. Maybe syntax like the following could be used to apply the > > storage class to the object value, and not the reference va

Re: const and immutable objects

2009-08-31 Thread Steven Schveighoffer
On Sun, 30 Aug 2009 18:31:33 -0400, Graham St Jack wrote: I have been trying (again) to start using const and immutable objects in a project, and found I kept getting stuck with the need to change the value of object references, which isn't allowed. I don't quite follow the argu

Re: const and immutable objects

2009-08-30 Thread Graham St Jack
ause: * It presents different interfaces for different kinds of wrapped types. * It doesn't let you access the wrapped object except via opDot. My suggested workaround is perhaps a bit rough, but it does work. I would like to hear from anyone who is using const and immutable objects in D2 who has something better, or has suggestions to improve my code.

Re: const and immutable objects

2009-08-30 Thread Jeremie Pelletier
Graham St Jack Wrote: > I have been trying (again) to start using const and immutable objects in > a project, and found I kept getting stuck with the need to change the > value of object references, which isn't allowed. I don't quite follow the > arguments that mean t

const and immutable objects

2009-08-30 Thread Graham St Jack
I have been trying (again) to start using const and immutable objects in a project, and found I kept getting stuck with the need to change the value of object references, which isn't allowed. I don't quite follow the arguments that mean that this has to be the case, but I'm prep