Re: object argument passing behaviour changed in v8.2.2? [message #86275 is a reply to message #86274] |
Tue, 22 October 2013 10:17  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Tuesday, October 22, 2013 10:59:18 AM UTC-6, Paul van Delst wrote:
> On 10/22/2013 11:57 AM, Chris Torrence wrote:
>
>>
>
>> Hi Paul,
>
>> I don't think this is a special case. It's also not
>
>> "semi-passed-by-reference." The code is simply passing an expression
>
>> into a routine, so IDL cannot store into it.
>
>> Cheers, Chris
>
>
>
> Well, that's not the case. Both your, and my corrected, test cases shows
>
> that you *can* store into the array element reference (well, the object
>
> that was referenced in that array element) in the callee.
>
>
>
> It was the "redefinition" of the object in the routine (or method) that
>
> was screwing things up.
>
>
>
> I know it won't (can't) change anytime soon, but I find the fact that an
>
> array element reference is considered an expression in IDL very
>
> confusing. It just doesn't grok well.
>
>
>
> IDL users should be shielded from under-the-hood details like argument
>
> passing mechanisms, IMO (that's my Fortran90/95/2003 side talking).
>
>
>
> cheers,
>
>
>
> paulv
Yep, I agree that a different decision would have been better. Unfortunately, we would have to travel back 30 years in time to tell David Stern... If I recall, Fortran 77 passed by reference (even for array elements), so David could have gotten it right... Oh well.
-Chris
|
|
|