Jump to content

Variadic function: Difference between revisions

Added Wren
m (→‎{{header|REXX}}: add dynamically built argument list)
(Added Wren)
Line 2,683:
'---'.print()
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}}==
9,483

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.