MACSCRPT Archives

November 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Peter Boardman <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 17 Nov 2006 23:12:24 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
I'm lucky enough to find all these list operations easy, as I use  
newLISP. On the down side, I have to use 'osascript' to communicate  
with Apple applications :-(
I haven't yet needed to convert lists between AppleScript and Lisp  
format...

(set 'list1 '(1 2 3 4 5 6))
(set 'list2 '(6 7 8 9 10))

(difference list1 list2)
;-> (1 2 3 4 5)

(difference list2 list1)
;-> (7 8 9 10)

(intersect list2 list1)
;-> (6)

(find 4 list1) ; find index of 4 in list1
;-> 3

(match '(* 4 5 *) list1 true)
;-> ((1 2 3) 4 5 (6))

which are the sort of things I wanted to see in AppleScript...

ATOM RSS1 RSS2