Named parameters: Difference between revisions
Content deleted Content added
m →{{header|Wren}}: Changed to Wren S/H |
|||
Line 2,136: | Line 2,136: | ||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
Wren doesn't support named parameters as such though they can be simulated using a map. |
Wren doesn't support named parameters as such though they can be simulated using a map. |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="wren">var printName = Fn.new { |name| |
||
if (!(name is Map && name["first"] != null && name["last"] != null)) { |
if (!(name is Map && name["first"] != null && name["last"] != null)) { |
||
Fiber.abort("Argument must be a map with keys \"first\" and \"last\"") |
Fiber.abort("Argument must be a map with keys \"first\" and \"last\"") |