[squeak-dev] String>>match: broken

Levente Uzonyi leves at elte.hu
Sat Jan 15 11:00:17 UTC 2011


On Sat, 15 Jan 2011, Janko Mivšek wrote:

> Hi Squeakers,
>
> Latest trunk version broke the Aida/web and Herbert managed to find the
> reason in new behavior of String>>match: which doesn't allow two '**' in
> pattern anymore. In Aida the matching patterns are usually composed out
> of many strings and as it happens two stars occurs in Aida's default
> installation already.
>
> Because this new match behavior (not allowing two '**') is new only in
> Squeak but allowed in all other Smalltalks, I propose to reconsider this
> decision and better retract back to old behavior.

The old behavior was definitely wrong. Here are two examples with the 
old behavior from the corresponding issue 
(http://bugs.squeak.org/view.php?id=6841 ):

'*#' match: 'e'. "false"
'**' match: 'e'. "false"

If you look at the previous version of the method from 2004 (I don't know 
if this is the original or not), then you'll see that it tried to raise an 
error if the string contained '**', but it failed to do so because of this 
bug. So the intended behavior - to disallow ** in the pattern - is not new 
at all.

IMHO the best solution to this problem is to rewrite the method to allow 
any combination of * and # in the pattern.


Levente

>
> Best regards
> Janko
>
>
> -- 
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
>
>


More information about the Squeak-dev mailing list