Skip to content

Instantly share code, notes, and snippets.

@anekos
Created January 26, 2009 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anekos/52651 to your computer and use it in GitHub Desktop.
Save anekos/52651 to your computer and use it in GitHub Desktop.
関数呼び出し元のローカル変数を参照&変更する
Foo := Object clone
Foo bar := method(
# 呼び出し元の値を参照
call sender v println
# 呼び出し元の値を書き換え!
call sender v = "new value"
)
Object clone do(
v := "local value"
Foo bar #=> local value
v println #=> new value
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment