D is our last hope
Daniel N
no at public.email
Mon Nov 27 18:03:08 UTC 2023
On Monday, 27 November 2023 at 10:22:52 UTC, Kagamin wrote:
> On Sunday, 26 November 2023 at 18:23:13 UTC, Daniel N wrote:
>> What's wrong with native kotlin?
>
> It's in hybrid pascal family.
> ```
> fun <T> Sequence<T>.chunked(size: Int): Sequence<List<T>>
> ```
> Is Sequence its approach to slices?
Well...
```kotlin
val array = arrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9)
val slice = array.sliceArray(0..3)
```
But check this sugar
https://kotlinlang.org/docs/lambdas.html#it-implicit-name-of-a-single-parameter
```kotlin
val sequenceResult = sequenceOf(1, 2, 3, 4, 5)
.filter { it % 2 == 0 }
.map { it * 2 }
.toList()
```
More information about the Digitalmars-d
mailing list