Variadic function: Difference between revisions
Content added Content deleted
(Add lang example) |
|||
Line 1,742: | Line 1,742: | ||
=={{header|Lambdatalk}}== |
=={{header|Lambdatalk}}== |
||
Lambdas are de facto variadic in lambdatalk |
Lambdas are de facto variadic in lambdatalk |
||
<syntaxhighlight lang="scheme"> |
<syntaxhighlight lang="scheme"> |
||
⚫ | |||
{lambda {:s} |
|||
⚫ | |||
⚫ | |||
else {br}{S.first :s} {foo {S.rest :s}}}}} |
|||
⚫ | |||
⚫ | |||
{lambda {:s} // :s will get any sequence of words |
|||
hello |
|||
⚫ | |||
brave |
|||
⚫ | |||
new |
|||
-> foo |
|||
world |
|||
{foo |
{foo hello brave new world} |
||
⚫ | |||
1 |
|||
2 |
|||
3 |
|||
4 |
|||
5 |
|||
6 |
|||
7 |
|||
8 |
|||
9 |
|||
10 |
|||
{foo {S.serie 1 10}} |
|||
-> 1 2 3 4 5 6 7 8 9 10 |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||