help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Perl, etc has these "?"-prefix modifiers/codes/whatever. Precisely w


From: Pascal J. Bourguignon
Subject: Re: Perl, etc has these "?"-prefix modifiers/codes/whatever. Precisely which does emacs have (and NOT have)?
Date: Fri, 19 Feb 2010 02:06:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (darwin)

John Withers <grayarea@reddagger.org> writes:

> On Thu, 2010-02-18 at 20:02 +0100, Pascal J. Bourguignon wrote:
> <snip>
>> 
>> In the case of "regular expressions", when you add certain extensions,
>> they're not regular expressions at all, so, I will just cite Jamie
>> Zawinski:
> <snip quote we all know here>
>
> While in the strict sense you are obviously correct, that really doesn't
> matter when you are programmer using a feature of your text editor. In
> practice we aren't using them to strictly define regular languages in
> some kind of formal language theory bakeoff. Well, I don't know that for
> a fact. You seem like a pretty smart guy and that might be your hobby.
> But in general, we are using them to get crap done.
>
> It doesn't matter to me if for reasons of formal definition we rename a
> modern regular expression engine as a MooCowPerlCrap engine in order not
> to conflict with the formal definition. I still will argue that having a
> MCPC engine would be a nice feature. Heck, emacs has a rich history of
> using terms that no one in the wider, growing world gets as time goes on
> anyway (I am talking to you, frames).
>
> sed, grep, xemacs and pretty much the entire rest of the ecosystem
> caught this idea quite some time ago, and it would be nice to have these
> features in emacs. 
>
> The quote you are pulling is from a discussion of exactly this issue, as
> I am sure you are aware. But the funny thing here is that Jamie in the
> last few years was using Perl extensively. He might not like it, but he
> was using it:
> http://regex.info/blog/2006-09-15/247#comment-3085
>
> I don't disagree that regexes might be a pain or overused, but what I
> don't get is the idea that if you are going to have them in the first
> place, you don't add some pretty handy features that the rest of the
> ecosystem has been using for decades now and won't degrade the base
> features, if for some reason of formal purity you decide to use only
> those.
>
> I dunno, then again, I might just not be getting the emacs way. I have
> only been using emacs a few years and my lisp skills aren't that strong,
> and except for org-mode I use my emacs almost always in its tertiary
> role as a programmers text editor.

One difficulty when you try to extend regular expression is that the
time and space complexity of matching such an extended regular
expression easily becomes exponential.  In these cases, it may be easier
to write a parser, than to try to force it thru regular expressions,
both for the programmer's brain and for the CPU processor...

Otherwise, people will do anything they want to do, theory and
precendent nonobstant.  This only demonstrate the lack of culture of the
newcomers.

-- 
__Pascal Bourguignon__


reply via email to

[Prev in Thread] Current Thread [Next in Thread]