Using '@' to mark pass-by-reference (was Re: synonyms)

Mike Kerner MikeKerner at roadrunner.com
Fri Aug 18 09:53:53 EDT 2017


I understand the difference.  I'm just trying to help with the mental
arithmetic.  I, and others, I'm sure, will constantly forget where the "@"
goes, for instance.

On Fri, Aug 18, 2017 at 9:48 AM, Mark Waddingham via use-livecode <
use-livecode at lists.runrev.com> wrote:

> On 2017-08-18 15:21, Mike Kerner via use-livecode wrote:
>
>> So how about trying to make it a little easier to read, and using "->"
>> instead (a 4D way of identifying pointers)?  The position of the symbol
>> indicates if we have are referencing or dereferencing.  ->a is a reference
>> to a (pointer to a), and a-> is dereferencing a (give me what a is
>> pointing
>> to).
>>
>
> Two reasons not to:
>
>   1) By-Reference parameters are not the same as pointers - in particular,
> dereferencing is implicit, and referencing is only allowed in the context
> of passing the parameter.
>
>   2) We already have a symbol '@' for marking by-ref parameters in handler
> signatures, so surely it makes more sense to use that in its directly
> equivalent position (on sending, as well as receiving).
>
> General references (I don't think using the term 'pointer' is appropriate)
> are a whole different kettle of fish which come with dragons waiting to eat
> you all over the place...
>
>
> Warmest Regards,
>
> Mark.
>
> --
> Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the Use-livecode mailing list