• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: copy & set statements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy & set statements


  • Subject: Re: copy & set statements
  • From: has <email@hidden>
  • Date: Tue, 23 Oct 2001 23:41:04 +0100

Timothy Bates wrote:

>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.

There was a time when I was also unaware of this problem - until I got
_burned_good_ by it... Cos just when I thought I'd got the hang of this
programming lark, I ran into this little beauty - not that I knew what it
was at the time. Three days later I had two huge black rings round my eyes
and my code looked like an explosion in an alphabet soup factory. Not
pretty. Tracking down such a bizarre bug in a 70K script turns out to be an
exercise in absolute futility when it's not the damn script that's at
fault.:(

It's hard to justify time spent writing scripts when something like this
means you could have done the job quicker by hand after all.

Don't get me wrong: data sharing is a sound concept. Less data copying =
increased speed and reduced memory requirements (if anything there ought to
be _more_ of it). But AS really needs to pay more attention to what's going
on and just DO those copies as needed. Perhaps a smarter compiler would be
the answer?

I dunno, this is getting beyond me. S'probably why I'm writing in
Applescript and not C++ or some "real" language. i.e. "Dear Apple, please
make Applescript smarter so I can be dumb (and not have to worry about it)."

has


  • Prev by Date: Re: Eudora: sending to more than 50 recipients
  • Next by Date: Re: copy & set statements
  • Previous by thread: Re: copy & set statements
  • Next by thread: Re: copy & set statements
  • Index(es):
    • Date
    • Thread