On Fri, Sep 29, 2000 at 02:14:26PM -0800, Michael Fowler wrote:
> On Fri, Sep 29, 2000 at 09:20:23PM -0000, Perl6 RFC Librarian wrote:
> > Although consensus so far is against the change, views were from B<existing>
> > perl users [who do you expect as the majority on perl6 lists? :-)]. The
> > change would penalise existing perl users, but benefit new perl users (and
> > presumably people teaching perl).
> 
> I'm not sure if this means you don't care about the opinions of existing
> Perl programmers or not, but perhaps you would like an opinion from a
> different direction.

Ah. I worded it badly then. I do care. I meant that the opinions of people
learning perl about single quoted strings and backslash would also be
interesting, but they are unlikely to be subscribed to the list.

> I hate the shell's single-quoting method.  If I have anything with single
> quotes in it (usually Perl oneliners, but that's neither here nor there) I
> have to find some alternative.  Usually I have to go back, change the
> quoting to "", and escape everything inside the single quotes.  This is

I tend to get annoyed and use '\'' to end the single quotes, put a literal
single quote in and re-open the single quotes. But that too is messy

> incredibly annoying.  With Perl it could be marginally better, what with the
> q// construct, but it still means that when I have a single quote internally
> I have to go back and change my delimiter, and verify I'm not using that
> same delimiter in the string.

Agree. Once one understands the single quoting system (and it's not hard)
Nested delimeters such as q{} are useful unless you're making strings where
the {} in them don't nest. But I agree that \ always working for ' and
always using '' is Keep It Simple Stupid, then therefore less prone to
bugs.
 
> Whew.  Disallowing escapes in a single-quote string does not make easy
> things easier and hard things possible.  The only thing it does is serve to
> make a shell programmer's introduction to Perl easier, maybe.  Is this
> really a reason to take a feature away from the rest of us?

I don't know if it's a good enough reason. I am interested in comments.

The single quoting system currently isn't hard. And the escaping is useful.

But it seems wrong that

        '\\bar' eq '\bar'

and that

        q(\\ \') ne q'\\ \''


At least with the double quoted backslash treatment \ followed by anything
is replaced by 1 character.

My opinion is that
  The current system is slightly irregular in the way it works.
  A less irregular system would be nicer (hindsight is a wonderful thing)
  It would have been nice to have had a less irregular system to start with
  But we don't
Hence
  Changing the current system represents upheaval
  Does the change bring a net benefit?
  Is that benefit worth the pain of the change?
  Or do we stick with what we've got.

Nicholas Clark

Reply via email to