Created
September 29, 2012 03:35
-
-
Save e2kaneko/3803073 to your computer and use it in GitHub Desktop.
GroovyのClosure(クロージャ)スコープ(静的スコープ/レキシカルスコープ)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.e2info.groovy | |
if(true){ | |
def a = 123 | |
b = {print a} | |
} | |
if(true){ | |
def a = 456 | |
b.call(); | |
} | |
/* | |
123 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment