When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-02 Thread Mehrdad
Could someone mention a case where it is __necessary__ to cast away const()? How about immutable()? How about shared()?

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-02 Thread Alex Rønne Petersen
On 02-05-2012 17:58, Mehrdad wrote: Could someone mention a case where it is __necessary__ to cast away const()? How about immutable()? How about shared()? shared? Almost always in any non-trivial application. shared is only useful if you're dealing with templatized functions that can actually

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-02 Thread David Nadlinger
On Wednesday, 2 May 2012 at 16:52:33 UTC, Alex Rønne Petersen wrote: shared? Almost always in any non-trivial application. shared is only useful if you're dealing with templatized functions that can actually handle it, which is not the case as often as one would like. Additionally, shared is

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-02 Thread Mehrdad
Okay, that's for shared. What about const though?

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-03 Thread Steven Schveighoffer
On Wed, 02 May 2012 12:59:34 -0400, David Nadlinger wrote: On Wednesday, 2 May 2012 at 16:52:33 UTC, Alex Rønne Petersen wrote: shared? Almost always in any non-trivial application. shared is only useful if you're dealing with templatized functions that can actually handle it, which is no

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-03 Thread David Nadlinger
On Thursday, 3 May 2012 at 13:40:41 UTC, Steven Schveighoffer wrote: On Wed, 02 May 2012 12:59:34 -0400, David Nadlinger wrote: Additionally, shared is currently little more than a marker for non-TLS data. No, it's very important that it is a type constructor. For example, it makes weak-pur

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-04 Thread Oleg Kuporosov
Hi folks, it was really good and productive discussion on const and immutability, special thanks for those (Jonatan,Steven,Cris,etc) who answered hard Mehrad's questions and clarified so important topics. Can I kindly ask you folks to update FAQ on the site to have ability for newcomers to