Re: what is the best way to 'unset' a variable
Re: what is the best way to 'unset' a variable
- Subject: Re: what is the best way to 'unset' a variable
- From: Arthur J Knapp <email@hidden>
- Date: Sun, 24 Mar 2002 11:29:42 -0500
>
Date: Sat, 23 Mar 2002 15:30:30 -0800
>
From: John W Baxter <email@hidden>
>
Subject: Re: what is the best way to 'unset' a variable
>
-- Throw away memory usage tester.
>
on run
This was a really nice test, good stuff John. :)
>
delay 30
The 30 second delays were a bit extreme, however... ;-)
>
You might very well ask:
>
Point 1: in an applet, a variable used in the run handler acts like a
>
global variable in terms of being stored on disk after the applet runs,
>
UNLESS it is explicitly declared to be local.
Which is a point that I constantly forget. :(
But then again, it doesn't come up very often for me, as almost
everything I do is within handlers.
>
5. OK, so why does one one-meg string use 3 meg of memory?
>
I think it goes like this: for at least an instant, three copies of
>
the string exist.
>
a. the copy made in the buildString handler
>
b. the copy the handler returned
>
c. the copy in the variable
>
The first two of these get garbage collected quickly, but not "quickly
>
enough".
Yeah, Chris Espinosa, (Apple Employee 8), once told us that AppleScript
uses something called stop-and-copy garbage collection. Here's a link:
<
http://listserv.dartmouth.edu/scripts/wa.exe?A2=ind9912&L=macscrpt&P=R13913
&D=1&H=0&O=D&T=1>
>
... AppleScript does not give memory back to the memory manager once
>
it has asked for the memory...it manages the memory itself. So to the
>
About this Computer application, the memory usage is what it was at the
>
instant the three copies existed.
This was really great, John. It is one thing to simply know these things
in one's head, and another altogether to seem them dynamically displayed,
thank you. :)
>
8. Why is a raven like a writing desk?
>
This is left as an exercise for the reader.
Lewis Carroll:
Enquiries have been so often addressed to me, as to whether any
answer to the Hatter's Riddle can be imagined, that I may as well
put on record here what seems to me to be a fairly appropriate
answer, viz: `Because it can produce a few notes, tho they are
very flat; and it is nevar put with the wrong end in front!' This,
however, is merely an afterthought; the Riddle, as originally
invented, had no answer at all.
You will notice that the word "never" was spelled "nevar". Some say
that this was intentional on Carroll's part, as nevar is raven spelled
backwards.
A few other answers:
Because the notes for which they are noted are not noted for being
musical notes. (Puzzle maven Sam Loyd, 1914)
Because Poe wrote on both. (Loyd again)
Because there is a B in both and an N in neither. (Get it? Aldous
Huxley, 1928)
Because it slopes with a flap. (Cyril Pearson, undated)
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://homepage.mac.com/ewalet/DeskTop.html>
on error number -128
end try
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.