Status: Accepted
Owner: [email protected]
Labels: Milestone-1.3

New issue 3547 by [email protected]: Have a look at the new match: implementation
http://code.google.com/p/pharo/issues/detail?id=3547

Collections-ul.420

    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.


answer:
------

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.


Reply via email to