Variadic function: Difference between revisions

m
(add BQN)
Line 641:
=={{header|BQN}}==
 
All BQN functions can be variadic since they allow taking lists of arbitrary length lists as arguments. A function can reject variadicity by defining a header to restrict the arguments to a specific length.
 
<lang bqn>Fun1 ← •Show¨
Line 647:
Fun3 ← { 1=≠𝕩 ? •Show 𝕩; "too many arguments " ! 𝕩}</lang>
 
Both <tt>Fun1</tt> and <tt>Fun2</tt> display all the values (arguments) of the lists given to them.
 
<tt>Fun3</tt> will throwthrows an error isif the argument given argument is not a lengthlist of length 1 list, or not a non-list at all. Otherwise it will displaydisplays its argument.
 
=={{header|C}}==
Anonymous user