|
|
|
|
|
by ReleaseCandidat
1024 days ago
|
|
> Just like every language that implicitly names the current value of the iterator Oh, i didn't know that there are any. It would be a good idea to add the naming explicitly to the Wiki entry of loops: https://jai.community/t/loops/147, I've just found it buried in the `remove` section. Btw. in for-loops the colon `:` is used inconsistently again, this time for naming the iterator (`foo` in this example:) `for foo: VALUES { ... }`. |
|
Plenty! Although, it's not limited to iterators: most languages that have first class lambdas/closures behave this way. Kotlin has `it` as the default parameter of any lambda (but only accepts it for single parameter lambdas, two parameters and you need to name them:
`fun <T, U> Collection<T>.map(block: (T) -> U): Collection<U>`
is called like so:
`listOf(1, 2, 3).map { it * it }`
Swift has $0, $1
>Btw. in for-loops the colon `:` is used inconsistently again, this time for naming the iterator (`foo` in this example:) `for foo: VALUES { ... }`.
Sorry, Jonathan Blow doesn't believe in such silly things as "compiler research" nor "programming language research". Jai gets built by piling up crap on top of crap.