Talk:Here document: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 17: Line 17:
:2 the text can get inserted in the middle of the line that invokes it.
:2 the text can get inserted in the middle of the line that invokes it.
:--[[User:Rdm|Rdm]] 08:14, 11 July 2011 (UTC)
:--[[User:Rdm|Rdm]] 08:14, 11 July 2011 (UTC)
<br>Some languages support multi-line literals, but those languages are from an age of fixed-length records, when programmers still used [punched] cards. [[User:Gerard Schildberger|Gerard Schildberger]] 08:46, 16 March 2012 (UTC)

Revision as of 08:46, 16 March 2012

Quackquack?

Aren't they usually called delimiters? --Paddy3118 04:56, 15 May 2011 (UTC)

I think he's talking about the << itself, rather than the delimiter that follows it. –Donal Fellows 22:26, 15 May 2011 (UTC)
Definitions or a reference are in order. I never heard of quackquack or here documents, and found nothing when I tried googling for these terms. Some languages I've worked with have a way of directing a file read function to treat some immediate data within the program as if it were an external file. Is that what we're talking about here, or is the task simply to express string literals with embedded whitespace? —Sonia 23:33, 15 May 2011 (UTC)
"quackquack" is slang for "<<" (sort of like "bang" is slang for "!"). Here documents have an article on wikipedia. Looks like it's just for literals. I had never heard either of the terms either. --Mwn3d 01:47, 16 May 2011 (UTC)
I am well aware of the term "here document", but have never heard of the term quackquack. [this search on google for both terms provided no hits. Might the original author consider a more mainstream phrase?
I have never heard the phrase used before for this purpose, and I could not find anything either, in google. That said, I imagine it's a visual pun, with < representing a duck's beak? --Rdm 11:26, 16 May 2011 (UTC)
It is a visual pun. In any case, I got rid of the phrase in the description. Don't worry about it anymore. --Mwn3d 12:20, 16 May 2011 (UTC)

Difference from multi-line string literals

Some examples here seem like basically multi-line string literals. So I want to ask: Are any multi-line string literals allowed? (I'm guessing the answer is probably no?) And if not, what is the dividing line that separates "here documents" from other multi-line string literals? Is it that it allows you to use a custom word of your choosing as a delimiter? (Python triple-quotes and many others do not satisfy this.) Is it that it allows you to use a delimiter that is more than one character? What is the criterion? --Spoon! 07:58, 11 July 2011 (UTC)

I think the distinctions are:
1 end delimiter takes a line by itself.
2 the text can get inserted in the middle of the line that invokes it.
--Rdm 08:14, 11 July 2011 (UTC)


Some languages support multi-line literals, but those languages are from an age of fixed-length records, when programmers still used [punched] cards. Gerard Schildberger 08:46, 16 March 2012 (UTC)