[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regexp and valid-sre?



I just briefly looked through the documentation for GNU Emacs and could not find the equivalent of  'valid-sre?'.

And it looks like the regular expressions are not compiled before they are used: string-match takes a regular _expression_ to search for as a string: http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Search.html#Regexp-Search Finally, the bottom of this page talking about using Icicles to interactively learn
about using regular expressions: http://www.emacswiki.org/emacs/RegularExpression
 
On 11/26/2013 12:18 PM, Arthur A. Gleckler wrote:

Implementing Emacs in Scheme is a use case for this.

On Nov 26, 2013 11:17 AM, "Michael Montague" <mikemon@xxxxxxxxx> wrote:
On 11/26/2013 10:24 AM, John Cowan wrote:
Michael Montague scripsit:

I don't think that these are strong arguments for having
'valid-sre?'. An implementation for which compiling is expensive,
could easily internally do the "is it valid"-type check before
compiling. Having it in the interface adds no functionality that is
not already easily available.
It tells the compiler only to syntax-check and not go on to actually
compile.  This is a very common feature in compilers: for example,
in gcc the -fsyntax-only option activates this mode.  Sometimes
all you want to know at present is whether something is syntactically valid.


The only use case for 'valid-sre?' mentioned so far is Peter's interactive regular _expression_ IDE. The C standard does not require the -fsyntax-only option. These do not seem like compelling arguments for including
'valid-sre?'.