better docs/2
This commit is contained in:
parent
ef266b73a2
commit
185aa4e0cf
@ -94,6 +94,7 @@ With ellipsis and splats you can create partial functions, manipulate
|
|||||||
arguments list in almost arbitrary ways. For example:
|
arguments list in almost arbitrary ways. For example:
|
||||||
|
|
||||||
// Swap first and last arguments for call
|
// Swap first and last arguments for call
|
||||||
|
|
||||||
fun swap_args(first, others..., last, f) {
|
fun swap_args(first, others..., last, f) {
|
||||||
f(last, ...others, first)
|
f(last, ...others, first)
|
||||||
}
|
}
|
||||||
@ -104,8 +105,8 @@ arguments list in almost arbitrary ways. For example:
|
|||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"321",
|
"4231",
|
||||||
swap_args( 1, 2, 3, glue)
|
swap_args( 1, 2, 3, 4, glue)
|
||||||
)
|
)
|
||||||
>>> void
|
>>> void
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user