[Seaside-dev] Re: [Seaside Issues] Issue 555 in seaside: SequenceableCollection>>#beginsWith: and #endsWith: are non-portable

Paolo Bonzini bonzini at gnu.org
Sun Mar 7 15:05:18 UTC 2010


On 03/07/2010 03:45 PM, John O'Keefe wrote:
> No, I'm only convinced that it different on different platforms, so it
> is a portability issue.  I'm happy with resolution in either direction (
> '123' startsWith: '' returns ture or false) since VA Smalltalk never
> implemented this method, although, since I've implemented the method in
> terms of #indexOf:

... isn't this horribly inefficient, as it is at least O(m+n) rather 
than O(min(m,n))?

  I guess I prefer the current Pharo and VA Smalltalk
> implementation since it seems more consistent., but I just think it
> needs to be consistent if Seaside is going to use it.

FWIW I now checked #indexOfSubCollection: in GST and it gives an out of 
bounds error if asked for the index of an empty collection.

I think #startsWith:/#endsWith: are substantially different from 
#indexOfSubCollection:, in that a limit value is clear for 
starting/ending with an empty string, but much less for "where is an 
empty string".

Paolo


More information about the seaside-dev mailing list