@@ -31,13 +31,13 @@ object ByNameParameter
3131 def takesUnitByNameParameter (res0 : Either [Throwable , Int ]) = {
3232 def calc (x : () => Int ): Either [Throwable , Int ] = {
3333 try {
34- Right (x()) // An explicit call of the x function
34+ Right (x()) // An explicit call of the x function
3535 } catch {
3636 case b : Throwable => Left (b)
3737 }
3838 }
3939
40- val y = calc { () => // Having explicitly declaring that Unit is a parameter with ()
40+ val y = calc { () => // explicitly declaring that Unit is a parameter with ()
4141 14 + 15
4242 }
4343
@@ -48,7 +48,7 @@ object ByNameParameter
4848 */
4949 def byNameParameter (res0 : Either [Throwable , Int ]) = {
5050 def calc (x : => Int ): Either [Throwable , Int ] = {
51- // x is a call by name parameter
51+ // x is a call by- name parameter
5252 try {
5353 Right (x)
5454 } catch {
@@ -57,16 +57,16 @@ object ByNameParameter
5757 }
5858
5959 val y = calc {
60- // This looks like a natural block
61- println(" Here we go!" ) // Some superfluous call
62- val z = List (1 , 2 , 3 , 4 ) // Another superfluous call
60+ // This looks like a natural block
61+ println(" Here we go!" ) // Some superfluous call
62+ val z = List (1 , 2 , 3 , 4 ) // Another superfluous call
6363 49 + 20
6464 }
6565
6666 y should be(res0)
6767 }
6868
69- /** By name parameters can also be used with `object` and `apply` to make interesting block-like calls:
69+ /** By- name parameters can also be used with `object` and `apply` to make interesting block-like calls:
7070 */
7171 def withApplyByNameParameter (res0 : String ) = {
7272 object PigLatinizer {
0 commit comments