You're right. Thanks for reminding me!
prefix(s, 0) returns an empty string prefix, "". To get the same effekt with .., one have to use s[..-1]. And *that's* the reason why it's hard to support s[..-k] for counting from the end of the string.
/ Niels Möller ()
Previous text:
2003-03-06 00:59: Subject: Re: negative indices in array ranges
The off-by-one issue is perhaps that prefix() wouldn't include the given position while suffix() would. That's a bit at odds with the range operator which takes an inclusive range in both directions. I.e.
suffix(x, 17) == x[17..]
but
prefix(x, 17) == x[..16]
/ Martin Stjernholm, Roxen IS