• 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: Records
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Records


  • Subject: Re: Records
  • From: email@hidden
  • Date: Wed, 28 Feb 2001 23:56:00 EST

In a message dated 2/28/01 11:22:33 PM,
email@hidden writes:

>Here's the easiest way to do it using only the standard additions:
>
>__begin script__
>
>to usrf(theList)
> set n to {<<class usrf>>:theList}
> run script "
> to run (arg)
> arg as record
> end run " with parameters n
>end usrf
>
>usrf({"a", 1, "b", 2})
>
>__ end script__

>>Left and right chevrons aside, this is f**king brilliant, ranking up there
>>with Motoyuki Tanaka's [":" as alias as string]. However, I have absolutely
>>no idea why it works, nor any guess as to how you came up with it.

I agree completely. I also don't really understand itcompletely! ;-)

Since I have a task before me that would greatly benefit from this technique
(and I wouldn't know where to start to implement it), I'll ask here how I
could utilize this in my situation. Here it is:

I have two lists:

set listOne to {"name1", "name2", "name3} -- list of file names
set listTwo to {date1, date2, date3} -- list of modification dates of files

What I want is a single list of records:

--> {{name:"name1", modDate:date1}, {name:"name2", modDate:date2},
{name:"name3", modDate:date3}}

Can I get there using this technique in some way? Or if there is an easier
way (vanilla only) to create the list of records (as above) of file names and
modification dates, I'd be all for that. Thanks in advance.

Ken Fleisher
email@hidden


  • Prev by Date: Re: I want to convert a list of integers to their negative self
  • Next by Date: Re: I want to convert a list of integers to their negative self
  • Previous by thread: Re: Records
  • Next by thread: Re: Records
  • Index(es):
    • Date
    • Thread