• 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: (beep) as string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: (beep) as string
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Getting label from a record (solution)
  • Next by Date: Re: set variable to a command?
  • Previous by thread: Re: (beep) as string
  • Next by thread: Re: (beep) as string
  • Index(es):
    • Date
    • Thread