It just occurred to me that when working with subsequences in Swift,
func suffix(from: Int)
seems to be identical to just dropFirst(_:)
(Obviously, you just change the input value from say "3" to "7" in the case of an array of length "10".)
Just to repeat that. So: of course, for an array of say length ten. What I mean is func suffix(from: Int)
with "2" would be the same as dropFirst(_:)
with "8", for example.
Similarly upTo
/ through
seem to be identical to dropLast(_:)
Other than convenience is there any difference at all?
(Perhaps in error conditions, performance, or?)
I was wondering whether, in fact, inside Swift one or the other is just implemented by calling the other?