I'm not really disagreeing with you. Having all this flexibility isn't
always a good thing. I'm not sure it's strictly a 'bug' because it's
consistent behaviour within a context. But the boundaries of the context
aren't visible when you're using it and that is a problem.

And I could have phrased my meaning a little better when I said I use all
three approaches. I've used all three but I've mostly abandoned returning
an object in favor of the other two as I described. The main reason being I
write most function methods that do anything complex to return an error
message (blank is good) and write the results to objects or variables
passed as pointers.

On Thu, Dec 1, 2016 at 8:36 AM, Peter Jakobsson <> wrote:

> On 1 Dec 2016, at 16:16, Kirk Brooks <> 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).
> Peter
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:
> Archive:
> Options:
> Unsub:
> **********************************************************************

Kirk Brooks
San Francisco, CA
4D Internet Users Group (4D iNUG)

Reply via email to