Seems like some scripters nowadays are running into "call-by-reference" issues (I really do dislike that term), so this feature would be somewhat nice to have.
I'd be happy with either a copy constructor (e.g. "new Obj(obj)") or some function that returns a copy (e.g. "obj.clone()").
Implementing this in an ASH function wouldn't at all be feasible since we'd need an overloaded form of the function for each distinct record.
Actually, implementation in Java isn't exactly trivial, either. Ideally there'd be a way to create a shallow copy as well as a deep copy (in the case that you have records with other records/arrays/maps as fields), but that's a substantially larger undertaking.
Either way, at the very least, in the underlying architecture, there's a way to iterate over the field names, so it'd probably be more straightforward and elegant than attempting this in ASH.
I'd be happy with either a copy constructor (e.g. "new Obj(obj)") or some function that returns a copy (e.g. "obj.clone()").
Implementing this in an ASH function wouldn't at all be feasible since we'd need an overloaded form of the function for each distinct record.
Actually, implementation in Java isn't exactly trivial, either. Ideally there'd be a way to create a shallow copy as well as a deep copy (in the case that you have records with other records/arrays/maps as fields), but that's a substantially larger undertaking.
Either way, at the very least, in the underlying architecture, there's a way to iterate over the field names, so it'd probably be more straightforward and elegant than attempting this in ASH.