Skip to content

Instantly share code, notes, and snippets.

@mcamou
Created August 19, 2011 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcamou/1156792 to your computer and use it in GitHub Desktop.
Save mcamou/1156792 to your computer and use it in GitHub Desktop.
mario@tumbolia ~ 1 % scala
Welcome to Scala version 2.9.0.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def x(a:Int,b:Int,c:Int,d:Int = 0) = println(a,b,c,d)
x: (a: Int, b: Int, c: Int, d: Int)Unit
scala> x(a=1,b=2,c=3)
(1,2,3,0)
scala> x(z=0,a=1,b=2,c=3)
<console>:9: error: parameter specified twice: a
x(z=0,a=1,b=2,c=3)
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment