Created
June 25, 2011 06:30
-
-
Save xuwei-k/1046237 to your computer and use it in GitHub Desktop.
名前渡し引数の挙動
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
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