Cool.  Thanks, Jay.

On Thu, Jun 6, 2019 at 12:25 PM Jay McCarthy <jay.mccar...@gmail.com> wrote:

> On Thu, Jun 6, 2019 at 12:16 PM David Storrs <david.sto...@gmail.com>
> wrote:
>
>>
>>
>> On Thu, Jun 6, 2019 at 12:14 PM Jay McCarthy <jay.mccar...@gmail.com>
>> 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 it with `subbytes` or
>>> `bytes-copy`, you are making a new object with a new pointer.
>>>
>>
>> Sweet, that's what I needed to know.  Thank you.
>>
>> What about other things, like arbitrary structs, (im)mutable strings,
>> hashes, etc?
>>
>
> Everything is like this except word sized objects like numbers but those
> are not mutable so you’d never know the difference (performance would be
> same too because the pointer would be word sized anyways.)
>
>
>>
>>
>>> --
>>> Jay McCarthy
>>> Associate Professor @ CS @ UMass Lowell
>>> http://jeapostrophe.github.io
>>> Vincit qui se vincit.
>>>
>>> On Thu, Jun 6, 2019 at 12:00 PM David Storrs <david.sto...@gmail.com>
>>> 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?
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "Racket Users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an email to racket-users+unsubscr...@googlegroups.com.
>>> > To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/racket-users/CAE8gKod0Z%2Bv-3Oew4mPhsT4mwzOLdhc7Q-nF4xf_yH3qAgq_Hg%40mail.gmail.com
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/CAE8gKodNrutKxDivmbpH7Pz_Y1Hg0BfiavQagVToYdm%2BHsr-%3DQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAE8gKodNrutKxDivmbpH7Pz_Y1Hg0BfiavQagVToYdm%2BHsr-%3DQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
>
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKocmn7W-GQoeEtrTKy_vN-7c2vfinT8tQ%3DTr0dvYEkM%3DBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to