Does any programming language exist to support the explicit, property-level object copy?For example, assume this code:public class Student{    public string Name { get; set; }    public string Code { get; set; }    public List<string> Interests { get; set; }}public class Item{    public string Name { get; set; }     public string Code { get; set; }}I wonder if there is a compiler (or a language) out there that can indirectly cast two objects to each other, based on property-level matching and a lossy transformation algorithm?Create an instance of the target classUsing reflection, find all properties of the target classFor each property, try to find a match in the source class, using name and typeIf found, transfer the valueOtherwise, initialize to the default valueOf course, this should be done explicitly with the full intention of the developer. For example, a C# pseudo-syntax might look like:Student student = new Student();student.Name = Saeed;student.Code = 513223;Item item = copy student; // assume copy to be a keyword// Here, item's name is Saeed and its code is 513223
Property-level value transformation for indirect object casting
programming languages;language design;type casting