Talk:Here document

message: Does anybody know - is it pronounced "hear dok" or "heh red oc" (sorry for bad attempts at spelling phonetically!) 213.253.35.7 13:08, 20 September 2006 (UTC)
replies: text: While I haven't heard it said often, it's always been "hear dok" (two syllables), presumably because it's a contraction of "here document". Mairi 17:10, 20 September 2006 (UTC)
thread_title: Pronounce

message: I don't have much knowledge of this topic, perhaps someone who does could add the distinction between 'Heredoc' and 'Nowdoc' in PHP?  They're delimited and behave slightly differently. 196.210.216.244 (talk) 03:48, 5 July 2010 (UTC)
thread_title:  todo ;; add 'Nowdoc' to PHP section 

message: add content on meaning of interpolation drefty.mac 04:05, 27 October 2006 (UTC)
thread_title:  todo ;; add interpolation 

message: I really like the back to the future example for windows power shell (whoever did that). It's funny and very creative. Unfortunately, it's also quite long. I hate to ask, but can you please cut it down substantially? At least so it is at least close to the size of the other examples. Thanks! dr.ef.tymac 19:48, 24 November 2006 (UTC)
replies: text: Never mind about shortening it, in reconsideration, the perl example is long also. But still, a more straightfoward example seems appropriate. It just seems like a bit much to demonstrate the difference between the two output results. dr.ef.tymac 19:51, 24 November 2006 (UTC)
thread_title:  Back to the future! 

message: What does the word "Here" refer to?  or what's its etymology?  Dofstead 17:25, 6 March 2007 (UTC)
replies: text: Probably here as in "a complete document right here". As opposed to theredoc (just found this myself: ). 193.143.216.169 11:54, 11 June 2007 (UTC)
thread_title:  "Here" ?? 

message: The article defines "here" documents as convenient multi-line string literals,
and gives examples including Python's triple-quoted strings.
I am almost sure this is incorrect.
In Bourne shell, Perl and I guess a few more,
the essential feature of a here document is that it isn't a string literal!
It is an input stream, like a temporary file containing that string.
It's indented to be fed as standard input to some external command.
The tr(1) example in the article is typical.
JöG (talk) 11:01, 16 February 2008 (UTC)
replies: text: ...and I guess that in PHP everything is heredoc by default, until you introduce any code with "php" tags. --Kubanczyk (talk) 22:37, 29 April 2008 (UTC)

text: JöG is correct. Almost everything in this article is wrong, because heredocs in the shell aren't string literals, they are file literals ... then perl borrowed the syntax but used it for string literals. Calling Python's """...""" literals "here documents" is stupid, but this misuse of the terminology has even found its way into the Python page. -- 98.108.206.178 (talk) 11:06, 29 March 2011 (UTC)

text: I agree. I would propose to narrow the definition to constructs where the user can designate an arbitrary, custom string as a tag, and then have all the lines up to that tag are included in the string. This will eliminate the Python triple-quoted strings, since triple quote is not a custom string. --208.80.119.67 (talk) 00:59, 7 September 2011 (UTC)

text: —Nils von Barth (nbarth) (talk) 13:51, 31 August 2013 (UTC)
thread_title:  Too wide definition 

message: Does anyone know the history of the heredoc - who thought of the heredoc? what was the first implementation? etc? Kwertii (talk) 09:46, 7 August 2008 (UTC)
replies: text: It is a Unix concept. Unix was originally sold to AT&T management as an office tool. Thus the implementation of Unix contains a number of text processing tools for formatting, etc., such as the boilerplate input found in this 'here document'; this arose in the 1970s. --Ancheta Wis (talk) 04:30, 19 July 2009 (UTC)
replies: text: What ridiculous drivel. The heredoc was introduced in UNIX but it had nothing to do with "office tools" or "text processing tools" -- it was a feature of the Bourne shell, allowing inline definition of temp files. -- 98.108.206.178 (talk) 11:01, 29 March 2011 (UTC)
replies: text: I see it in V7, but not in V6, sh(1). http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/man/man1/sh.1. I think this (or better) should be in the article. 91.154.87.201 (talk) 14:48, 23 March 2012 (UTC)
thread_title: History of the concept?

message: Isn't there a vulnerability of the delimiting identifier accidentally occurring within the string literal? --Abdull (talk) 23:07, 27 January 2010 (UTC)
replies: text: No, "literals" are compile-time constructs in the source code. A string literal only serves to represent a sequence of characters. At runtime it is just a sequence of characters like any other string. "Vulnerabilities" which are runtime things therefore are not relevant. --208.80.119.67 (talk) 01:01, 7 September 2011 (UTC)
thread_title:  delimiting identifier in string literal 

message: These examples are absolutely awful!  They're long and tedious and pretty much worthless.  If anyone actually needed such language-specific detail of how Powershell or Perl or some other language implemented all the various bells, whistles and go-fasters in its version of a here document, it is ridiculous to imagine that this is where they'd look to find it.  The whole article appears to be the hodgepodge result of the fans of these various languages not wanting to be outdone by fans of the competing languages in listing all the remarkable reasons why their favorite language is best.  This just doesn't need to be here. If no one objects in the next few days, I'm going to delete a lot of this junk and trim the article down (unless someone else beats me to it!)  Msnicki (talk) 08:07, 24 October 2010 (UTC)
replies: text: I've added the "External links" section, with a link to a Rosetta Code task on here documents that fulfils the  same function as the list of language examples here. But is that enough to warrant removing the examples in this entry ? --Paddy (talk) 11:27, 7 September 2011 (UTC)
thread_title:  Dreadful, tedious examples! 

message: I don't know PHP but, looking at: 
echo strtolower($toprint);
I would expect the output to be converted in lower case and look like:
 hey joe smith! you can actually assign the heredoc section to a variable!
rather than the current:
 Hey Joe Smith! You can actually assign the heredoc section to a variable!
Am I wrong?
I have no way to test it...
Jack-cnv (talk) 12:00, 28 February 2012 (UTC)
replies: text: No sir, you are entirely correct! In fact, I only came here to see if there had been any discussion of it. I have just tested it with PHP 5.4 on Linux, standard configuration, and it's total nonsense - strtolower would drop all the uppercase letters down. strtolower also has absolutely sod all to do with an example of heredoc strings, so I shall be removing it entirely from the example. -Joey- (talk) 11:05, 29 March 2012 (UTC)
thread_title:  Bug in PHP ? 

message: "Tcl has no special syntax for heredocs, because the ordinary string syntaxes already allow embedded newlines and preserve indentation."
This is a non-sequitur. The ordinary string syntaxes of Perl, Ruby and PHP allow embedded newlines and preserve indentation; yet all three also support heredoc syntax.
Given that Tcl doesn't support heredocs, why are there Tcl examples at all?  — Preceding unsigned comment added by 109.155.240.244 (talk) 14:20, 5 March 2012 (UTC)
thread_title:  TCL 

message: I vote for this TODO - Aaronchall (talk) 18:05, 24 May 2016 (UTC)
thread_title:  TODO: excise all examples except for Bash after verifying they are in RosettaCode and make the RosettaCode link more prominent. 

message: Hello fellow Wikipedians,
I have just modified one external link on Here document. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added archive https://web.archive.org/web/20140529084958/http://content.hccfl.edu/pollock/ShScript/HereDoc.htm to http://content.hccfl.edu/pollock/ShScript/HereDoc.htm
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
Cheers.—InternetArchiveBot (Report bug) 11:57, 1 April 2017 (UTC)
thread_title:  External links modified 

message: When is this technique from? 2020s? 1980s? First implementation, who came up with it? Would be nice to know... 104.172.234.209 (talk) 18:17, 30 January 2023 (UTC)
thread_title:  Please add history