AppleScript名:2つの1D List同士の消し込み |
— Created 2017-10-29 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set list1 to {5, 1, 2, 3, 1, 6, 2, 7, 8, 2, 6, 5, 4} set list2 to {6, 7, 8} set result1 to my removeItemsInList:list2 fromList:list1 –> {5, 3, 1, 4, 2} set result2 to removeItems for list2 from list1 –> {5, 3, 1, 4, 2} set result3 to removeItemsFrom(list1, list2) of me –> {5, 3, 1, 4, 2} –Objective-Cライクなパラメータ記述 on removeItemsInList:list2 fromList:list1 set set2 to current application’s NSSet’s setWithArray:list2 set set1 to current application’s NSMutableSet’s setWithArray:list1 set1’s minusSet:set2 return (set1’s allObjects()) as list end removeItemsInList:fromList: –無意味区による装飾 on removeItems for list2 from list1 return my removeItemsInList:list2 fromList:list1 end removeItems –Pure AS風のパラメータ記述 on removeItemsFrom(list1, list2) return my removeItemsInList:list2 fromList:list1 end removeItemsFrom |
More from my site
(Visited 19 times, 1 visits today)