fixed bug with callable argument in calls, added more docs

This commit is contained in:
sergeych committed 2025-06-02 18:33:45 +04:00
1 parent 4a597886e6
commit 29c643eed2
3 files changed
+26 -3

No files matched your search

+8
View File
@@ -316,6 +316,14 @@ one could be with ellipsis that means "the rest pf arguments as List":
assert( { a, b...-> [a,...b] }(100, 1, 2, 3) == [100, 1, 2, 3])
void
### Using lambda as the parameter
fun mapValues(iterable, transform) {
var result = []
for( x in iterable ) result += transform(x)
}
assert( [11, 21, 31] == mapValues( [1,2,3], { it*10+1 }))
>>> void
# Lists (aka arrays)