1
votes

What's it called when you tell an object to clone all of its arguments (like in deep cloning), but the top-level object isn't changed?

I need to implement this sort of method in a program, and I'm just trying to figure out what to call the method.

Say that we're cloning Foo, which is referenced by several other objects. If we were doing deep-level cloning, then our clone's arguments would be inaccessible to other objects which reference Foo. In this (currently unidentified) type of cloning, if we clone Foo, then other objects referencing Foo would have access to the the newly cloned arguments.

1
I think what's more relevent is why are you doing this? For a generic object, this makes no sense. Obviously it has sense to you, so you are working with details that are relevent.Mooing Duck
You say "clone all of its arguments". It's not clear what you mean by that (objects don't have arguments), but the best guess I have would be defensive copying.user2357112 supports Monica
It sounds like you're doing: forall attr in obj: obj.attr := deepcopy(obj.attr) Is that correct?thebjorn
I don't think there's a name for that. I'd suggest naming the method with something that relates to the reason why you're doing this.thebjorn
Your current namings seem very sensible (at least it will make it easy to figure the code out six months from now). parameter_simplification seems like the logical choice..?thebjorn

1 Answers

2
votes

I don't think there's a name for that. I'd suggest naming the method with something that relates to the reason why you're doing this.