Re: [racket-users] Are function parameters copy on write?

2019-06-06 Thread David Storrs
Cool. Thanks, Jay. On Thu, Jun 6, 2019 at 12:25 PM Jay McCarthy wrote: > On Thu, Jun 6, 2019 at 12:16 PM David Storrs > wrote: > >> >> >> On Thu, Jun 6, 2019 at 12:14 PM Jay McCarthy >> wrote: >> >>> Your code is passing bytes by value, but bytes are themselves >>> pointers, so you are

Re: [racket-users] Are function parameters copy on write?

2019-06-06 Thread Jay McCarthy
On Thu, Jun 6, 2019 at 12:16 PM David Storrs wrote: > > > On Thu, Jun 6, 2019 at 12:14 PM Jay McCarthy > wrote: > >> Your code is passing bytes by value, but bytes are themselves >> pointers, so you are passing copies of the pointer, not copies of the >> bytes. When you modify it, with

Re: [racket-users] Are function parameters copy on write?

2019-06-06 Thread David Storrs
On Thu, Jun 6, 2019 at 12:14 PM Jay McCarthy wrote: > Your code is passing bytes by value, but bytes are themselves > pointers, so you are passing copies of the pointer, not copies of the > bytes. When you modify it, with `bytes-set!` you are modifying the > underlying structure. When you copy

Re: [racket-users] Are function parameters copy on write?

2019-06-06 Thread Jay McCarthy
Your code is passing bytes by value, but bytes are themselves pointers, so you are passing copies of the pointer, not copies of the bytes. When you modify it, with `bytes-set!` you are modifying the underlying structure. When you copy it with `subbytes` or `bytes-copy`, you are making a new object

Re: [racket-users] Are function parameters copy on write?

2019-06-06 Thread Jon Zeppieri
On Thu, Jun 6, 2019 at 12:00 PM David Storrs wrote: > My understanding is that Racket is call by value, not call by reference. > My application will often be passing around large-ish byte strings; will > they be copied every time I pass them, or will the interpreter use > copy-on-write? >

[racket-users] Are function parameters copy on write?

2019-06-06 Thread David Storrs
My understanding is that Racket is call by value, not call by reference. My application will often be passing around large-ish byte strings; will they be copied every time I pass them, or will the interpreter use copy-on-write? -- You received this message because you are subscribed to the