Error String>>#copyReplacingAllRegex:with:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error String>>#copyReplacingAllRegex:with:

Isaac Gouy
Seems like
   String>>#copyFrom:to:replacingAllRegex:with:

expects a nil rather than a FailedMatchRegexResults ?

See
http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gst&id=0#log

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Error String>>#copyReplacingAllRegex:with:

Paolo Bonzini
Isaac Gouy wrote:

>Seems like
>   String>>#copyFrom:to:replacingAllRegex:with:
>
>expects a nil rather than a FailedMatchRegexResults ?
>
>See
>http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gst&id=0#log
>  
>
Indeed.  I attach a patch; you can include the fixed methods in the
regexdna.st file in order to run the benchmark with 2.2.

Paolo

--- orig/examples/regex.st
+++ mod/examples/regex.st
@@ -515,7 +515,7 @@
     | regs beg end repl res |
     regs := self searchRegex: pattern from: from to: to.
 
-    regs notNil
+    regs matched
  ifTrue: [
     beg := regs from.
     end := regs to.
@@ -544,7 +544,7 @@
     idx := from.
     [
         regs := self searchRegex: regex from: idx to: to.
- regs notNil
+ regs matched
     ] whileTrue: [
  beg := regs from.
  end := regs to.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Error String>>#copyReplacingAllRegex:with:

Isaac Gouy
Thanks, see
http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gst&id=0

Any thoughts on the ackermann problem?


--- Paolo Bonzini <[hidden email]> wrote:

> Isaac Gouy wrote:
>
> >Seems like
> >   String>>#copyFrom:to:replacingAllRegex:with:
> >
> >expects a nil rather than a FailedMatchRegexResults ?
> >
> >See
>
>http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gst&id=0#log
> >  
> >
> Indeed.  I attach a patch; you can include the fixed methods in the
> regexdna.st file in order to run the benchmark with 2.2.
>
> Paolo
> > --- orig/examples/regex.st
> +++ mod/examples/regex.st
> @@ -515,7 +515,7 @@
>      | regs beg end repl res |
>      regs := self searchRegex: pattern from: from to: to.
>  
> -    regs notNil
> +    regs matched
>   ifTrue: [
>      beg := regs from.
>      end := regs to.
> @@ -544,7 +544,7 @@
>      idx := from.
>      [
>          regs := self searchRegex: regex from: idx to: to.
> - regs notNil
> + regs matched
>      ] whileTrue: [
>   beg := regs from.
>   end := regs to.
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Error String>>#copyReplacingAllRegex:with:

Paolo Bonzini
Isaac Gouy wrote:

>Thanks, see
>http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gst&id=0
>
>Any thoughts on the ackermann problem?
>  
>
Hm, not yet.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk