Re: (beep) as string
Re: (beep) as string
- Subject: Re: (beep) as string
- From: Arthur Knapp <email@hidden>
- Date: Wed, 19 Nov 2003 12:58:57 -0500
From: Christopher Nebel <email@hidden>
Subject: Re: (beep) as string
Date: Tue, 18 Nov 2003 15:53:58 -0800
set x to {}
set x's end to x --> {{...}}
Recursive structures may be undocumented, but they're perfectly
supported, at least for now. There's a bunch of code to deal with
them, and I even added the "..." printing myself. However, no one has
ever found a practical use for them that I'm aware of.
Hmm....
Well, one might want to create a circular linked-list solution for
some problem, something along these lines:
-- silly example:
property nil : missing value
set head to {itemOf:nil, linkOf:nil}
set node to head
repeat with c in "abc"
set node's linkOf to {itemOf:c's contents, linkOf:nil}
set node to node's linkOf
end repeat
set node's linkOf to head
head
-- { itemOf : missing value,
-- linkOf :
-- { itemOf : "a",
-- linkOf :
-- { itemOf : "b",
-- linkOf :
-- { itemOf : "c",
-- linkOf :
-- { itemOf : missing value,
-- linkOf :
-- { itemOf : "a",
-- linkOf :
-- { itemOf : "b",
-- linkOf :
-- { itemOf : "c",
-- linkOf : ...
-- }
-- }
-- }
-- }
-- }
-- }
-- }
-- }
I remember reading somewhere about an algorithm called something like
the "Joseph" problem, where circular structures like the one above are
used for running around the circle and deleting various links based on
some criteria. Off the top of my head, I can't think of any AppleScript
purpose for this.
{ Arthur J. Knapp;
<
mailto:email@hidden>;
Why do programmers confuse Halloween and Christmas?
Because Oct 31 == Dec 25.
}
_______________________________________________
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.