Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created June 25, 2011 06:30
Show Gist options
  • Save xuwei-k/1046237 to your computer and use it in GitHub Desktop.
Save xuwei-k/1046237 to your computer and use it in GitHub Desktop.
名前渡し引数の挙動
scala> def foo(a: => String){println("foo");println(a)}
foo: (a: => String)Unit
scala> def bar(b:Int):String = {println("bar "+b); ( b * 2 ).toString }
bar: (b: Int)String
scala> foo(bar(2))
foo
bar 2
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment