Rainer Deyke wrote:
Christopher Wright wrote:
You can create a COW array struct pretty easily. However, this will be
pretty slow in a lot of cases.
A built-in COW type does not need to be slow! The compiler can use
static analysis to eliminate unnecessary copies, and reference counting
can be
Christopher Wright wrote:
> You can create a COW array struct pretty easily. However, this will be
> pretty slow in a lot of cases.
A built-in COW type does not need to be slow! The compiler can use
static analysis to eliminate unnecessary copies, and reference counting
can be used to further red
Qian Xu wrote:
Denis Koroskin wrote:
The "Hello, World!" string is not allowed to be modified, because it could
be shared throughot the project and will be most probably put in a
read-only memory causing segfault at modification.
But it you need to have a modified version of this this, you crea
On Fri, 16 Jan 2009 19:15:03 +0300, Qian Xu wrote:
Denis Koroskin wrote:
The "Hello, World!" string is not allowed to be modified, because it
could
be shared throughot the project and will be most probably put in a
read-only memory causing segfault at modification.
But it you need to have
Denis Koroskin wrote:
>
> The "Hello, World!" string is not allowed to be modified, because it could
> be shared throughot the project and will be most probably put in a
> read-only memory causing segfault at modification.
>
> But it you need to have a modified version of this this, you create it
On Fri, 16 Jan 2009 10:30:53 +0300, Qian Xu wrote:
When shall I use some_var.dup and when not?
Is there any guidlines?
--Qiansua
.dup is typical way to makes a copy of variable:
char[] greetings = "Hello, World!".dup;
You usually do this when you want to modify variable that you are not al
On Fri, 16 Jan 2009 20:30:53 +1300, Qian Xu
wrote:
When shall I use some_var.dup and when not?
Is there any guidlines?
--Qian
Yeah when you want one to be different than the other. If the lvalue is a
slice then there is no need though.