References and copy-on-write

2002-07-24 Thread Aaron Sherman
I had assumed Perl6 will have copy-on-write references, so that $x = [1,2,3]; @y = *$x; would not require a copy. However, on thinking about it further, I realized that that would get you in trouble here: $x = [1,2,3]; %h{$x} = 1; @y = *x; $x[0]++; print %h{$x

Re: Copy-on-write strings

2002-05-10 Thread Graham Barr
On Fri, May 10, 2002 at 12:12:41PM -0400, Dan Sugalski wrote: > At 5:38 PM +0200 5/10/02, Peter Gibbs wrote: > >The result is that the last header of a COWed string will still believe that > >the buffer is shared until a GC collection run occurs, and therefore could > >result in buffers being copi

Re: Copy-on-write strings

2002-05-10 Thread Dan Sugalski
At 5:38 PM +0200 5/10/02, Peter Gibbs wrote: >The result is that the last header of a COWed string will still believe that >the buffer is shared until a GC collection run occurs, and therefore could >result in buffers being copied unnecessarily. Your system eliminates this >problem; however, I bel

Re: Copy-on-write strings

2002-05-10 Thread Peter Gibbs
Hi Nicholas The final design is now waiting on Dan, but it is always interesting to see other ideas. Like you, I rejected the parent/child technique. However, my proposed solution did not use any links at all, because it relies on the garbage collection system to determine when a shared buffer h

Re: Copy-on-write strings

2002-05-09 Thread Peter Gibbs
- Original Message - From: "Dan Sugalski" <[EMAIL PROTECTED]> > Actually, we don't. (Sez the man catching up on altogether too much > mail) Since we're putting the COW stuff at the tail end, substrings > of COW strings are fine. You set the bufstart to where the substring > starts, buflen

Re: Copy-on-write strings

2002-05-09 Thread Dan Sugalski
At 10:58 AM +0200 5/6/02, Peter Gibbs wrote: >The COWing of substrings requires a major interface change: >*** All references to the data in a STRING must use the new strstart pointer >instead of bufstart *** Actually, we don't. (Sez the man catching up on altogether too much mail) Since we're p

Copy-on-write strings

2002-05-06 Thread Peter Gibbs
Although the tidying up of resources.c is not complete yet, I decided to implement COW strings anyway. This implementation handles the following: Copied strings and substrings are COWed instead of copied (i.e. new string header only); this applies to normal and constant strings. Functions that al

Re: copy-on-write

2001-12-01 Thread Bryan C. Warnock
On Saturday 01 December 2001 09:24 pm, Bryan C. Warnock wrote: {snip} Er, obviously, s/is/should be/g in my response. -- Bryan C. Warnock [EMAIL PROTECTED]

Re: copy-on-write

2001-12-01 Thread Bryan C. Warnock
On Saturday 01 December 2001 01:50 pm, Jeff 'japhy' Pinyan wrote: > $x = "_" x 100_000; > $a = $x; $b = $x; $c = $x; > > $x is now copy-on-write, with three dependents. > > $x = "foo"; > > According to you model, we've just co

RE: copy-on-write

2001-12-01 Thread Dan Sugalski
At 09:30 AM 12/1/2001 -0800, Brent Dax wrote: >First of all, you sent us this already. :^) > >Jeff 'japhy' Pinyan: ># I'm writing a simple language to embody the concept of ># copy-on-write, and ># so that I can learn how to implement it. The languag

Re: copy-on-write

2001-12-01 Thread Uri Guttman
>>>>> "J'P" == Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes: J'P> $x = "_" x 100_000; J'P> $a = $x; $b = $x; $c = $x; J'P> $x is now copy-on-write, with three dependents. J'P> $x = 

RE: copy-on-write

2001-12-01 Thread Jeff 'japhy' Pinyan
On Dec 1, Brent Dax said: >First of all, you sent us this already. :^) Well, I sent it before I subscribed (and from a different account entirely) and it hadn't showed up in the archives 12 hours after posting, so I figured it was dixed. ># So what's copy-on-write? Basically,

RE: copy-on-write

2001-12-01 Thread Brent Dax
First of all, you sent us this already. :^) Jeff 'japhy' Pinyan: # I'm writing a simple language to embody the concept of # copy-on-write, and # so that I can learn how to implement it. The language is # called COW and # it's at # # http://japhy.perlmonk.org/COW/ # # B

copy-on-write

2001-12-01 Thread Jeff 'japhy' Pinyan
I'm writing a simple language to embody the concept of copy-on-write, and so that I can learn how to implement it. The language is called COW and it's at http://japhy.perlmonk.org/COW/ Ben Tilly suggested I contact the Perl6 Internals folk and let you know that this is an importa

copy-on-write (sorry if this is a duplicate)

2001-11-30 Thread Jeff 'japhy' Pinyan
I'm writing a simple language to embody the concept of copy-on-write, and so that I can learn how to implement it. The language is called COW and it's at http://japhy.perlmonk.org/COW/ Ben Tilly suggested I contact the Perl6 Internals folk and let you know that this is an importa