LoginSignup
2
1

More than 5 years have passed since last update.

AppleScriptでクロージャー

Last updated at Posted at 2013-02-06
closure_of_applescript.scpt
(* closure of applescript *)

on theClosure()
    script outer
        property x : 0
        script inner
            set x to x + 1
        end script
    end script
    return inner of outer
end theClosure

set s to theClosure()

run s
run s
run s
run s
run s
-- result : 5
2
1
2

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
2
1