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.
-- 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/CAJYbDam4SpLL-vt0q78NpqT_GbxVeLhxkN_UWKB%3DTsKz2zsE%2BA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.