On Thu, May 26, 2011 at 7:19 PM, Ingy dot Net <[email protected]> wrote:
> I think he is referring to the pot calling the kettle black, implying that
> Python is as "legacy" as Perl. I concur.
>
> There is so much energy in the Perl 5 and Perl 6 worlds right now, it makes
> working in Python feel like I'm "slumming it". But I still contribute to
> PyPI and attend/present at Python events because at the end of the day, we
> are just 2 beautiful drops in the bucket of a Java/C# sludge world. I think
> it behooves us to work together. Perl has taken many good ideas that started
> in Python and Ruby, and made them better for Perl. Python could learn a lot
> from looking at Perl and Ruby.

Let's not forget that Python's regular expression syntax came from
Perl, and that it hasn't kept up with Perl's later features. Before
the 're' module there was an older 'regex' module that had an ugly
choice of Awk and two other syntaxes (Emacs and Sed?). Awk was the
closest to Perl but had less features. But one of the others was the
default, I think Emacs, and you had to set a module variable at the
beginning of every script to choose Awk mode, and hope that none of
the libraries you were using had another mode.

The Awk and Perl syntaxes are consistent: alphabetical characters are
literals, and symbols are special.  So 'n' is a literal but '\n' is
special, while '(' is special and '\(' is a literal. The Emacs mode
was inconsistent so '[' was special but '(' was a literal, meaning
that you had to write '\(' for its special meaning, which made it look
like it was doing the opposite of what it was doing.

-- 
Mike Orr <[email protected]>

Reply via email to