yast/y2r

deep copy in assign and return

Closed this issue · 3 comments

We need deep copy in assign and return to not pass reference but copy of value.

I added deep_copy to return values and fixed its usage in assignments. I'll re-generate the pacakges and submit them at 16:00 if the image gets built in the afternoon.

@jreidinger Going back to our discussion in person — I think integers aren't a problem. It is true hat they can overflow from Fixnum to Bignum, but Bignums are immutable (there is no operation that would change Bignum's numerical value), so no deep copy is needed for them.

I also think about terms and paths. From the code in Ruby bindings it seems thay are pretty much immutable now (except Term#[]=). If they are only modified via builtins, maybe we can avoid copying them too. What do you think?

I agree. I think that main problem is map an list, which is sensitive to modifications

OK, I filed new issues for strings, terms and paths:

  • #29 for Y2R
  • #59 for Ruby bindings

This issue is closed.