Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

1..5 syntax has been deprecated for about 2 years, now you have 1...5 which is inclusive and 1..<5 which excludes the last element.


does it work with expressions? foo()...bar()? I can count on no fingers the amount of times I've hardcoded the length of a loop in production code.


Yes it does. (both ... and ..< can be used with expressions that return an int)


I was talking about Kotlin here.


Ah, I read your comment badly, sorry.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: