From ffe967e1ea8e916caf5a5bff810e3b7ae25ccb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=A4rtl?= Date: Mon, 13 May 2024 10:38:50 +0200 Subject: [kotlin/en] Parentheses can be omitted for single lambda args (#4708) --- kotlin.html.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kotlin.html.markdown') diff --git a/kotlin.html.markdown b/kotlin.html.markdown index a6fac518..48abce3a 100644 --- a/kotlin.html.markdown +++ b/kotlin.html.markdown @@ -127,7 +127,10 @@ fun helloWorld(val name : String) { // Named functions can be specified as arguments using the :: operator. val notOdd = not(::odd) val notEven = not(::even) - // Lambda expressions can be specified as arguments. + /* + Lambda expressions can be specified as arguments. + If it's the only argument parentheses can be omitted. + */ val notZero = not {n -> n == 0} /* If a lambda has only one parameter -- cgit v1.2.3