Newsgroups: gnu.emacs.help
From: LanX <lanx.p...@googlemail.com>
Date: Thu, 29 Sep 2011 02:33:52 -0700 (PDT)
Local: Thurs, Sep 29 2011 5:33 am
Subject: Re: Perl mode and y=>
> > For some reason, Perl mode behaves oddly
Sorry, but I don't like these kind of complaints ...
> Perl is... odd. I've used perl for a long time with emacs. You just learn to live with the problems.
The OP wants to use a special Perl DWIM feature called "autoquoting",
But if you put a variable or function on the LHS it will be evaluated
$key="k"; %h=($key => 1)
And IMHO the parsing rules are not too complicated: "check for
At least cperl-mode gets it right.
Now how do other languages solve this problem?
AFAI can see Python has nothing like autoquoting", everything unquoted
x={"a":1}
And JS has autoquoting, but the LHS is _never_ evaluated:
x={a:1}
You can't make an omelette without breaking eggs.
If you want python's semantics you need python's restrictions and put
> Perl's syntax has too many cases of context sensitive interpretations of characters. It's just hell to make emacs capable to deal with all this. I suspect Perl is the only software capable of parsing perl code :-)
True unfortunately the grammar doesn't have a formal specification,
but there IS a module on CPAN called PPI, doing the parsing extremely well. > If it's any consolation, we managed to convince Larry Wall back in the days when perl 5 was being "designed" to not follow Tom Christiansen's idea of what the scope operator should be. Tom wanted the single quote. Most prefered C++'s :: for familiarity and friendlyness to parsers. If you think things are bad now, imagine having the single quote has the scope operator :-)
The simple quote was the Perl4 standard and is for compatibility
reasons still supported in Perl5. But I think it will be deprecated soon. IIRC the perldoc cites "problems with emacs" for changing this
Cheers
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||