Re: copy & set statements
Re: copy & set statements
- Subject: Re: copy & set statements
- From: Timothy Bates <email@hidden>
- Date: Tue, 23 Oct 2001 23:42:46 +1000
On 23/10/01 11:08 PM, "Nigel Garvey" <email@hidden>
wrote:
>
on myHandler(myList)
>
set item 1 of myList to "a" -- make a change within the list
>
end myHandler
>
>
set theCat to {"woody", "hungry"}
>
>
myHandler(theCat)
>
return theCat
>
>
-->>{"a", "hungry"}
Demonstrating that, indeed, handler parameters ARE passed as pointers and
others as values. Geeze, that is a really bad inconsistency in the
language, and one of which I was unaware.
I guess the way around it is that _everything_ should be passed as a
pointer. At least that way you would know what is going on without having to
remember the datatype.
tim