Skip to content

Commit

Permalink
Introduce asOpenInterval in Interval
Browse files Browse the repository at this point in the history
  • Loading branch information
guillep committed Feb 2, 2021
1 parent 4d2cbd0 commit 3a78119
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Collections-Sequenceable/Interval.class.st
Expand Up @@ -170,6 +170,18 @@ Interval >> anyOne [
^self at: 1
]

{ #category : #converting }
Interval >> asOpenInterval [
"Return a new interval representing the open version of the receiver.
In other words, the new inteval does not contain the upper and lower boundaries of the receiver
"

"(1 to: 10) asOpenInterval >>> (2 to: 9)"
"(10 to: 1 by: -1) asOpenInterval >>> (9 to: 2)"

^ start + step to: stop - step
]

{ #category : #accessing }
Interval >> at: anInteger [
"Answer the anInteger'th element."
Expand Down

0 comments on commit 3a78119

Please sign in to comment.