From 13878d4e0dce0970eee148d07f54bc06810efa4a Mon Sep 17 00:00:00 2001 From: Yen-Cheng Chou Date: Tue, 28 Nov 2017 16:41:36 -0500 Subject: [PATCH] Update Indentation of named argument document Update the indentation so the method can be beautifully highlighted on the website. --- _tour/named-arguments.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_tour/named-arguments.md b/_tour/named-arguments.md index e69466580c..c7a8dc99a4 100644 --- a/_tour/named-arguments.md +++ b/_tour/named-arguments.md @@ -16,13 +16,13 @@ redirect_from: "/tutorials/tour/named-arguments.html" When calling methods, you can label the arguments with their parameter names like so: ```tut - def printName(first: String, last: String): Unit = { - println(first + " " + last) - } +def printName(first: String, last: String): Unit = { + println(first + " " + last) +} - printName("John", "Smith") // Prints "John Smith" - printName(first = "John", last = "Smith") // Prints "John Smith" - printName(last = "Smith", first = "John") // Prints "John Smith" +printName("John", "Smith") // Prints "John Smith" +printName(first = "John", last = "Smith") // Prints "John Smith" +printName(last = "Smith", first = "John") // Prints "John Smith" ``` Notice how the order of named arguments can be rearranged. However, if some arguments are named and others are not, the unnamed arguments must come first and in the order of their parameters in the method signature.