• 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: POSIX and lists question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX and lists question


  • Subject: Re: POSIX and lists question
  • From: "John R." <email@hidden>
  • Date: Fri, 12 Aug 2005 16:25:17 -0400

Mark J. Reed wrote:
>set thePaths to map(theFiles, POSIXize)
>
> Or I could use the apply() function to modify the list in place:
>
>apply(theFiles, POSIXize)
>
> Yeah, I know, mixing metaphors with Perl and Lisp, but I don't know how to
>write a single handler that will honor changes made within the passed-in
>closure.


HTH wrote:
>>And are these _real_ constructs in people's scripts?
>Not in AppleScript because, as I've pointed out, the behaviour is both undocumented and broke


Gary wrote:
>And this is becoming clearer, and I see the utility of that kind of
>construct. And I also see why it's pretty far [from] the kinds of things that basic
>AS applications need do (not that they wouldn't benefit from being able to
>do.)


Thank you, Mark & Gary and HTH. I learned something listening to you guys.

One point I am confused about: Are Mark's "map" and "apply" examples the right way to do this in AS, or (as HTH seems to imply with his AS complaint) are Mark's routines going to yield unexpected results sometimes?

It seems that Mark's handlers would be very useful models for similar AS handlers: for sorting a list, or for selecting item(s) from a list using custom criteria. Another benefit is to clean up my code by pushing annoying repeat blocks into (a few simple-to-maintain) handlers.

- John

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: POSIX and lists question
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: set offsetGrif to offset of keyword in webText
  • Next by Date: Re: POSIX and lists question
  • Previous by thread: Re: POSIX and lists question
  • Next by thread: Re: POSIX and lists question
  • Index(es):
    • Date
    • Thread