FAQ
Login
GNU social JPは日本のGNU socialサーバーです。
Usage
/
ToS
/
admin
/
test
/
Pleroma FE
Public
Public
Network
Groups
Featured
Popular
People
Embed Notice
HTML Code
<blockquote style="position: relative; padding-left: 55px;"><section><a href="https://mathstodon.xyz/users/gregeganSF/statuses/111595811954963101">Greg Egan (gregegansf@mathstodon.xyz)'s status on Sunday, 17-Dec-2023 21:49:20 JST</a><a href="https://mathstodon.xyz/@gregeganSF" title="gregegansf@mathstodon.xyz"><img src="https://gnusocial.jp/avatar/35283-48-20240131065946.webp" width="48" height="48" alt="Greg Egan" style="position: absolute; left: 0; top: 0;">Greg Egan</a></section><article><p>AppleScript is a very weird language.</p></article><footer><a rel="bookmark" href="https://gnusocial.jp/conversation/2465245#notice-4877299">In conversation</a><time datetime="2023-12-17T21:49:20+09:00" title="Sunday, 17-Dec-2023 21:49:20 JST">about 8 months ago</time> <span>from <span><a href="https://mathstodon.xyz/@gregeganSF/111595811954963101" rel="external" title="Sent from mathstodon.xyz via ActivityPub">mathstodon.xyz</a></span></span><a href="https://mathstodon.xyz/@gregeganSF/111595811954963101">permalink</a><h4>Attachments</h4><ol><li><label><a rel="external" href="https://gnusocial.jp/attachment/1978703">An AppleScript program:set {count1, count2, count3, count4} to {0, 0, 0, 0} set A to {"a", "b", "c", "a"}(* Test various ways of counting the number of occurrences of "a" in the list A *)(* Supposedly "the contents of" is needed to extract the actual value of "item i of A", but apparently not so here *)repeat with i from 1 to the length of A if (item i of A) = "a" then set count1 to count1 + 1 if (the contents of item i of A) = "a" then set count2 to count2 + 1 end repeat(* Supposedly "repeat with x in A" sets x to "item 1 of A", "item 2 of A" ... but the behaviour is different; here "the contents of" is obligatory to match the "a" *)repeat with x in A if x = "a" then set count3 to count3 + 1 if (the contents of x) = "a" then set count4 to count4 + 1 end repeatget {count1, count2, count3, count4}Result:{2, 2, 0, 2}</a></label><br><a href="https://media.mathstodon.xyz/media_attachments/files/111/595/810/973/669/378/original/f82e328b0b255f72.png" rel="external">https://media.mathstodon.xyz/media_attachments/files/111/595/810/973/669/378/original/f82e328b0b255f72.png</a></li></ol></footer></blockquote>
Corresponding Notice
Embed this notice
Greg Egan (gregegansf@mathstodon.xyz)'s status on Sunday, 17-Dec-2023 21:49:20 JST
Greg Egan
AppleScript is a very weird language.