Skip to content

Instantly share code, notes, and snippets.

@e2kaneko
Created September 29, 2012 03:35
Show Gist options
  • Save e2kaneko/3803073 to your computer and use it in GitHub Desktop.
Save e2kaneko/3803073 to your computer and use it in GitHub Desktop.
GroovyのClosure(クロージャ)スコープ(静的スコープ/レキシカルスコープ)
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