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

There are 2 forms of range in ruby: inclusive 2 dots - 1..5 => 1, 2, 3, 4, 5 and exclusive 3 dots 1...5 => 1, 2, 3, 4

It's always felt deeply counter-intuitive to me because .. feels like it represents less than ... but that's a separate discussion.



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

Search: