Re: [Vala] Object cloning in Vala for Java Developers



Emad Al-Bloushi wrote:
Peace be upon you all,

does Vala support object cloning like Java "shallow copy" and "deep copy" ? 

if yes kindly add samples in http://live.gnome.org/Vala/ValaForJavaProgrammers page

Best regards,

I found this answer by Jürg to a similar question (it was about
automatic cloning) in an IRC chat log:

"<juergbi> we won't add automatic clone methods. this could lead to
strange issues as you never know how deep the cloning is imagine you
have a class with an ArrayList as field  should it just copy the
reference to the list or clone the whole list?  if you want implicit
copies, use structs. if structs don't fit your use case, write your own
clone method with clearly defined semantics"


Best regards,

Frederik



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]