Variadic function: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) m (→{{header|REXX}}: add dynamically built argument list) |
(Added Wren) |
||
Line 2,683: | Line 2,683: | ||
'---'.print() |
'---'.print() |
||
self.f(1, 2)</lang> |
self.f(1, 2)</lang> |
||
=={{header|Wren}}== |
|||
Wren doesn't support variadic functions and doesn't really need to as we can just write a function which takes one (or one more) argument and pass it a list. |
|||
<lang ecmascript>var printArgs = Fn.new { |args| args.each { |arg| System.print(arg) } } |
|||
printArgs.call(["Mary", "had", "3", "little", "lambs"])</lang> |
|||
{{out}} |
|||
<pre> |
|||
Mary |
|||
had |
|||
3 |
|||
little |
|||
lambs |
|||
</pre> |
|||
=={{header|XLISP}}== |
=={{header|XLISP}}== |