Forgive me for a new question and potentially incorrect terminology.
Clojure vector functions produce values that do not include stop value. For example:
=> (subvec [:peanut :butter :and :jelly] 1 3)
[:butter :and]
=> (range 1 5)
(1 2 3 4)
The document for the range explicitly states this, but does not give a rational one: "... Returns the lazy number nums from the beginning (inclusive) to the end (exclusive) ...".
In Ruby, these operations are included:
(1..5) .to_a => [1, 2, 3, 4, 5] [: peanuts ,: butter ,: and ,: jelly] [1,3] => [: butter ,: and ,: jelly ]
Obviously, these are very different languages, but I wonder if there was any underlying reason besides the personal preferences of the language developers?
source
share