News for hackers. Stuff that matters.
Re:Again on 0-based vs. 1-based indexing by LandR on Wednesday January 20, 2021 @08:17AM (#25846036)
It's range that gets me all the time, some make the end inclusive, some exclusive.

    Clojure
    (range 1 10)
     ;=> (1 2 3 4 5 6 7 8 9)

    C#
    Enumerable.Range(1, 10).PrintAll();
    1 2 3 4 5 6 7 8 9 10
    
    Ruby
    (1..10).each { |n| puts n }
    #=> 1 2 3 4 5 6 7 8 9 10

    Python
    for i in range(1, 10):
    print(i, end=', ')
    => 1 2 3 4 5 6 7 8 9
Re:Again on 0-based vs. 1-based indexing by redka on Wednesday January 20, 2021 @08:26AM (#25846135)
well Ruby is a weird example since it has both using either '..' or '...'
Re:Again on 0-based vs. 1-based indexing by LandR on Wednesday January 20, 2021 @08:36AM (#25846230)
Oh, I didn't know about '...'