On 1 Dec 2016, at 16:16, Kirk Brooks <lists.k...@gmail.com> wrote:

> I use all three of the instances discussed: direct referencing of the $1
> object, pointers to the object and returning an object as $0.

Hi Kirk

The problem is, it shouldn’t really work like this IMO.

Strictly speaking it’s a bug - the fact that a method argument remains coupled 
to it’s source in the calling method despite being explicitly passed by value 
rather than by reference.

myMethod($object)  <— 4D’s pass “by value” syntax
myMethod(->$object)  <— 4D’s pass “by reference” syntax

At least thats the way I’m increasingly seeing it ;)

4D have done a fantastic job of making this very complex data structure into 
“just another variable” for us in every other respect which I think is a bit of 
genius actually.

It’s just this 1 banana skin that’s been left in place. I think they should get 
rid of it (the coupling between caller and called) and make it observe the same 
syntax as all other data types. (The “banana skin” behaviour could be left in 
place with one of those compatibility options in future upgrades for safety).


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:4d_tech-unsubscr...@lists.4d.com

Reply via email to