Talk:String literal
From Wikipedia, the free encyclopedia
I think that the "raw quoting" mechanism attributed to Python might have prior art in Perl, as in the q%string% style of quoting. Ccreitz 01:55, 14 June 2006 (UTC)
Contents |
[edit] tone
- Immediately the problem arises: how do you include quotation marks themselves in the strings? If the language allows the use of both styles of quotation marks (e.g. Modula-2), then you can embed one style by quoting with the other style:
Is anyone else sick of this folksy tutorial writing in Wikipedia? The second-person voice is particularly absurd. This is an encyclopedia, not a guide on anything.
[edit] draft to improve tone and npov
todo items still in wiki code drefty.mac 07:20, 27 October 2006 (UTC)
[edit] Variable interpolation
Under the Variable interpolation section I could not get the perl code to work. Here is my log
homebox:~ jpben$ cat testr.pl
#!/usr/bin/perl
$sName = "Nancy";
$sGreet = "Hello World";
print r'$sName said $sGreet to the crowd of people.';
print $/;
homebox:~ jpben$ perl testr.pl
Bad name after r' at testr.pl line 4.
homebox:~ jpben$ perl -v |head -n2
This is perl, v5.8.6 built for darwin-thread-multi-2level
I know in perl you dont need the r, since single quotes do not do variable interpolation. Perhaps this r is a mistake?
- There is no r in the perl example. You may be referring to the "raw string" example, which is not perl, and is not a feature of perl for the reason you specified. dr.ef.tymac 02:21, 20 November 2006 (UTC)
[edit] Double-up and Triple-up escape sequence
To me, Double-up and Triple-up escape sequences are completely different concepts which should not share the same headline; triple delimiters are no escape sequences at all but an extension to the dual quoting style. --TobiasHerp 12:49, 10 April 2007 (UTC)
- Good point. The article has been changed. dr.ef.tymac 15:35, 10 April 2007 (UTC)

