3 ms·
-Is- it well demonstrated here? I think everyone would understand what 'range' means pretty quickly, just by executing it. I can see someone saying "I don't get
by lostcolony 12y ago
-Is- it well demonstrated here? I think everyone would understand what 'range' means pretty quickly, just by executing it. I can see someone saying "I don't get 'foldl'" (or even worse, foldl vs foldr), and really -meaning- it, but regardless of whether range(1, 2) gives me [1] or [1, 2], I'm pretty sure people would 'get' it just by trying a few examples in the console/shell.
- mannykannot 12y agoYes, it is a clear example of an abstraction with semantics not fully explained by the name, and your solution of testing it does not contradict this point. More importantly, your solution doesn't scale to more complex abstractions, or to more complex properties, such as whether it is thread-safe or what exceptions it could throw. Plenty of bugs result from mistaken assumptions about such things, or simply by overlooking them.