AppleScript名:1D List中の存在確認(n vs n) |
— 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 {8, 9, 10} set list3 to {6, 7, 8} set result1 to my doesList:list1 containList:list2 –> false set result2 to my doesList:list1 containList:list3 –> true set result1 to doesListContain for list1 by list2 –> false set result1 to doesListContain for list1 by list3 –> true set result1 to doesListContainAB(list1, list2) of me –> false set result2 to doesListContainAB(list1, list3) of me –> true –Objective-Cライクなパラメータ記述 on doesList:list1 containList:list2 set set1 to current application’s NSSet’s setWithArray:list1 set set2 to current application’s NSSet’s setWithArray:list2 return ((set2’s isSubsetOfSet:set1) as integer = 1) end doesList:containList: –無意味区による装飾 on doesListContain for list1 by list2 set result1 to my doesList:list1 containList:list2 return result1 end doesListContain –Pure AS風のパラメータ記述 on doesListContainAB(list1, list2) set result1 to my doesList:list1 containList:list2 return result1 end doesListContainAB |
More from my site
(Visited 18 times, 1 visits today)