On Nov 1, 2017, at 11:04 AM, Keisuke Miyako wrote: > like a global preference, to the effect of > > "Call OB Copy implicitly when performing object assignments" > > it is an interesting point of view, > to frame it as an issue of the assignment operator being different, > as opposed to how objects and their properties are different "because they > are references".
I like that idea. If you are an “expert” or an optimization fanatic working to reduce every millisecond and every byte of memory used, you turn the preference OFF. Everything works like it currently does. You know what your are doing and if you make a mistake, it’s on you. Existing databases upgraded to the new version have this preference turned OFF. So it functions the same as it does now. But for newly created databases this preference is turned ON. So a new 4D developer does not have to deal with this issue/problem. But the “expert” developer can go turn this preference OFF. Or maybe you could add a new assignment operator like “==“. You modify how “:=“ works with object fields so it does the “implicit copy assignment” you talk about. But if you are an “expert” and know what you are doing, then you use the new “==“ assignment operator. This does this reference assignment thing that the current “:=“ operator does for objects. Then you have the best of both worlds. Experts can get the optimizations or whatever with “==“. The rest of us won’t care and just use good old “:=“ and know it works as expected in all situations. No need to think about all this reference stuff. The big problem is there is a lot of code out there dealing with objects. So changing how object assignments and references could break existing code that relies on these features and probably don’t even know it. Just throwing out ideas. I don’t know what would be the correct solution. It is good we are having this discussion because this will lead to a change/solution to this issue. Tim ******************************************** Tim Nevels Innovative Solutions 785-749-3444 [email protected] ******************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

