Luke Palmer writes:
: I'm sort of side-tracking from the trend of discussions, but I was just 
: thinking that I always found it annoying how you had to double backslashes 
: in single-quoted strings.  I like the bash's behavior with regard to this 
: much better... I mean, the whole idea behind single-quoted strings is that 
: there are no escape sequences. If someone really needs to put a single 
: quote in a single-quoted strings, what's wrong with this?:
: 
:       'You think I' _ q{'} _ 'm knit-picking!'
: 
: The analagous holds for q{} sequences. Furthermore, here documents don't 
: mimic this behavior:
:       print <<'EOT'
: Foo\\bar
: EOT
: 
: Print's precisely Foo\\bar. So are we doing something about this?

Well, if anything, we're going the other direction, and enriching what
you can do with a backslash in single quotes slightly.  But it ought
to be pretty easy to define your own hyperquotes.  We might also have
options on quotes like we do on regexen.  Then we could tell it what
to interpolate and what not to:

    q:bsahfmc/\t $foo @array %hash &func() $obj.method() { closure }/

'Course, that's pretty klunky.  So maybe we have something like an
immediate subroutine definition:

    my sub qa is quote("bsahfmc") {...}
    qa/\t $foo @array %hash &func() $obj.method() { closure }/

Then you could say something like:

    my sub q is quote("") {...}
    'You think I' _ q{'} _ 'm knit-picking!'

to get the behavior you want.

Larry

Reply via email to