Perl6 RFC Librarian wrote :
|| =head1 TITLE
|| 
|| Single quotes don't interpolate \' and \\
|| 
|| =head1 VERSION
|| 
||   Maintainer: Nicholas Clark <[EMAIL PROTECTED]>
||   Date: 28 Sep 2000
||   Last Updated: 29 Sep 2000
||   Mailing List: [EMAIL PROTECTED]
||   Number: 328
||   Version: 2
||   Status: Developing

   [ ... ]

|| =head1 DISCUSSION
|| 
|| Limited discussion so far because I wrongly issued the RFC to
|| [EMAIL PROTECTED] The only responses were from two people both
|| of whom valued their ability to use single quotes to make strings including
|| making strings containing single quotes. Here docs already provide a means to
|| get "quote nothing, everything is literal". One argued that
|| 
||      Single-quoted strings need to be able to contain single quotes,
||      which means some escape mechanism is required.
|| 
|| which I did not agree with.

Being able to create strings that contain arbitrary characters is
essential for program generators.  With the current quoting method,
you can take a string, preface any ' or \ with a \, wrap the result
with '' and you're ready to insert it into the code you're creating.

With the proposed definiton, you'd have to use a q## form, after
scanning the string in hopes of finding a character, like #, that
wasn't contained in the string.  With a here document, you'd instead
have to ensure that you create an end of here doc token that doesn't
happen to be contained as a line in the string.  (Here doc strings
are also awkward for some purposes, having the actual content of the
string on a separate line interferes with the normal flow for reading
the code, unless the string is multi-line data.)

-- 
Sleep should not be used as a substitute    | John Macdonald
for high levels of caffeine  -- FPhlyer     |   [EMAIL PROTECTED]

Reply via email to