1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

関数をリスト変数の要素とする(AppleScript)

Posted at

こんにちは。
AppleScript のリスト変数の中に関数 (user handler) を入れ、動作することを確認しました。

set i to 1
set f_ to item i of {f1, f2}
get f_("w") -- results in "w_1"

-- functions (user handlers)
on f1(x)
	return x & "_1"
end f1

on f2(x)
	return x & "_2"
end f2
  • なお下記のように書くと構文エラーとなりました(end of line などがあるべきところですが“(”が見つかりました。)。
get (item i of {f1, f2})("w")
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?