Jump to content

Named parameters: Difference between revisions

→‎{{header|C sharp|C#}}: Additional demonstration of named parameter ordering.
(Added C# (4.0))
(→‎{{header|C sharp|C#}}: Additional demonstration of named parameter ordering.)
Line 99:
{{works with|C sharp|C#|4.0}}
 
Named parameters were added in C# 4.0. The examples below demonstrate how named parameters and optional parameters are a single concept in the language.
 
<lang csharp>using System;
Line 116:
AddWidget("root", 320, 240, "First");
AddWidget("root", text: "Origin");
AddWidget("root", x: 500);
AddWidget("root", y: 500, text: "Footer", y: 400);
}
}
Line 127:
parent = root, x = 0, y = 0, text = Origin
parent = root, x = 500, y = 0, text = Default
parent = root, x = 0, y = 500400, text = Footer</pre>
 
 
=={{header|Clojure}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.