On 12/9/20 2:28 PM, Vern Paxson wrote:
It already varies with type of variable for assignments and function
call parameters.  Thus I’m puzzled at the desire for deep-copy over
shallow-copy, given that Zeek is already primarily shallow-copy.

Access to the variable here is so natural (in the script code, not the implementation) that I don't immediately think of assignment semantics at all. So I intuitively compared it to other languages, where I'd tend to expect i to be a (deep) reference. If we cover the behavior in the docs I'm fine with either.

Regardless of where this lands, your point strikes me as a great one to work into our current docs push. I just did a bit of digging and I can't find much that describes Zeek's shallow/deep or reference/value semantics. I see a bit in the description of copy(), in that of closures, and in CHANGES by some guy in 2005:

- The manual has been updated to clarify that aggregate values in events
  are passed as shallow copies, so that modifications to elements of the
  values after posting the event but before it's handled will be visible
  to the handlers for the events (Christian Kreibich).

:)

Best,
Christian
_______________________________________________
zeek-dev mailing list -- zeek-dev@lists.zeek.org
To unsubscribe send an email to zeek-dev-le...@lists.zeek.org

Reply via email to