GNU bug report logs - #2816
regexp-opt: does not optimize 'Abc' and 'abc'

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Sun, 29 Mar 2009 15:35:04 UTC

Severity: wishlist

To reply to this bug, email your comments to 2816 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2816; Package emacs. (Sun, 29 Mar 2009 15:35:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jari Aalto <jari.aalto <at> cante.net>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 29 Mar 2009 15:35:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jari Aalto <jari.aalto <at> cante.net>
To: Emacs bug BTS <submit <at> debbugs.gnu.org>
Subject: regexp-opt: does not optimize 'Abc' and 'abc'
Date: Sun, 29 Mar 2009 18:28:55 +0300
A)

    (regexp-opt
      '("Abc"
        "abc"))

    => "\\(?:[Aa]bc\\)"

B)

    (regexp-opt
      '("Abc"
        "def"
        "abc"))

    => "\\(?:Abc\\|abc\\|def\\)"

Shouldn't regexp-opt optimize B case as well?

Jari




Tags added: patch Request was from Jari Aalto <jari.aalto <at> cante.net> to control <at> emacsbugs.donarmstrong.com. (Sun, 29 Mar 2009 16:40:05 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2816; Package emacs. (Sun, 29 Mar 2009 17:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 29 Mar 2009 17:20:03 GMT) Full text and rfc822 format available.

Message #12 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jari Aalto <jari.aalto <at> cante.net>
Cc: 2816 <at> debbugs.gnu.org,
        Emacs bug BTS <submit <at> debbugs.gnu.org>
Subject: Re: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc'
Date: Sun, 29 Mar 2009 13:13:09 -0400
> A)

>     (regexp-opt
>       '("Abc"
>         "abc"))

>     => "\\(?:[Aa]bc\\)"

> B)

>     (regexp-opt
>       '("Abc"
>         "def"
>         "abc"))

>     => "\\(?:Abc\\|abc\\|def\\)"

> Shouldn't regexp-opt optimize B case as well?

The `opt' of regexp-opt should be understood in the sense of
optimization used in compilers, not in the formal mathematical sense of
"optimal".  I.e. it does some effort to improve things, but without any
guarantee about what is and what isn't optimized.

So, yes, it would be good if it did do what you suggest, but it's not
a bug if it doesn't.


        Stefan



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2816; Package emacs. (Sun, 29 Mar 2009 17:20:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 29 Mar 2009 17:20:05 GMT) Full text and rfc822 format available.

Severity set to `wishlist' from `normal' Request was from Jari Aalto <jari.aalto <at> cante.net> to control <at> emacsbugs.donarmstrong.com. (Sun, 29 Mar 2009 20:50:07 GMT) Full text and rfc822 format available.

Tags removed: patch Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 07 Apr 2009 02:40:05 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.