Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
---
from: http://rosettacode.org/wiki/Here_document

View file

@ -0,0 +1,16 @@
A   ''here document''   (or "heredoc")   is a way of specifying a text block, preserving the line breaks, indentation and other whitespace within the text.
Depending on the language being used, a &nbsp; ''here document'' &nbsp; is constructed using a command followed by "<<" (or some other symbol) followed by a token string.
The text block will then start on the next line, and will be followed by the chosen token at the beginning of the following line, which is used to mark the end of the text block.
;Task:
Demonstrate the use of &nbsp; ''here documents'' &nbsp; within the language.
;Related task:
* &nbsp; [[Documentation]]
<br><br>
{{omit from|Delphi}}

View file

@ -0,0 +1,4 @@
print(
here
doc
)

View file

@ -0,0 +1,4 @@
quote *
Hi
there
* .

View file

@ -0,0 +1,17 @@
#!/usr/local/bin/a68g --script #
[]STRING help = (
"Usage: thingy [OPTIONS]",
" -h Display this usage message",
" -H hostname Hostname to connect to"
);
printf(($gl$,help,$l$));
printf(($gl$,
"The river was deep but I swam it, Janet.",
"The future is ours so let's plan it, Janet.",
"So please don't tell me to can it, Janet.",
"I've one thing to say and that's ...",
"Dammit. Janet, I love you."
))

View file

@ -0,0 +1,6 @@
BODY⎕INP 'END-OF-⎕INP'
First line
Second line
Third line
...
END-OF-⎕INP

View file

@ -0,0 +1,8 @@
]boxing 8
s """
abc
def
GHIJK
"""
s

View file

@ -0,0 +1,56 @@
/* ARM assembly Raspberry PI */
/* program heredoc.s */
/* Constantes */
.equ STDOUT, 1 @ Linux output console
.equ EXIT, 1 @ Linux syscall
.equ WRITE, 4 @ Linux syscall
.equ BUFFERSIZE, 100
/* Initialized data */
.data
szMessString: .asciz "String :
ABCD
EFGH TAB \n"
szCarriageReturn: .asciz "\n"
/* UnInitialized data */
.bss
/* code section */
.text
.global main
main:
ldr r0,iAdrszMessString @ display message
bl affichageMess
100: @ standard end of the program
mov r0, #0 @ return code
mov r7, #EXIT @ request to exit program
svc 0 @ perform system call
iAdrszMessString: .int szMessString
iAdrszCarriageReturn: .int szCarriageReturn
/******************************************************************/
/* display text with size calculation */
/******************************************************************/
/* r0 contains the address of the message */
affichageMess:
push {r0,r1,r2,r7,lr} @ save registers
mov r2,#0 @ counter length */
1: @ loop length calculation
ldrb r1,[r0,r2] @ read octet start position + index
cmp r1,#0 @ if 0 its over
addne r2,r2,#1 @ else add 1 in the length
bne 1b @ and loop
@ so here r2 contains the length of the message
mov r1,r0 @ address message in r1
mov r0,#STDOUT @ code to write to the standard output Linux
mov r7, #WRITE @ code call system "write"
svc #0 @ call system
pop {r0,r1,r2,r7,lr} @ restaur registers
bx lr @ return

View file

@ -0,0 +1,20 @@
with Ada.Containers.Indefinite_Vectors, Ada.Text_IO;
procedure Here_Doc is
package String_Vec is new Ada.Containers.Indefinite_Vectors
(Index_Type => Positive,
Element_Type => String);
use type String_Vec.Vector;
Document: String_Vec.Vector := String_Vec.Empty_Vector
& "This is a vector of strings with the following properties:"
& " - indention is preserved, and"
& " - a quotation mark '""' must be ""escaped"" by a double-quote '""""'.";
begin
Document := Document & "Have fun!";
for I in Document.First_Index .. Document.Last_Index loop
Ada.Text_IO.Put_Line(Document.Element(I));
end loop;
end Here_Doc;

View file

@ -0,0 +1,3 @@
0 Q$ = CHR$ (34)
1 M$ = CHR$ (13)
2 PRINT Q$"Oh, Danny Boy,"M$"The pipes, the pipes are calling"M$"From glen to glen and down the mountainside"Q$

View file

@ -0,0 +1,22 @@
print {:
The “Red Death” had long devastated the country.
No pestilence had ever been so fatal, or so hideous.
Blood was its Avator and its seal—
the redness and the horror of blood.
There were sharp pains,
and sudden dizziness,
and then profuse bleeding at the pores,
with dissolution.
The scarlet stains upon the body
and especially upon the face of the victim,
were the pest ban
which shut him out from the aid
and from the sympathy of his fellow-men.
And the whole seizure,
progress and termination of the disease,
were the incidents of half an hour.
:}

View file

@ -0,0 +1,9 @@
MyVar = "This is the text inside MyVar"
MyVariable =
(
Note that whitespace is preserved
As well as newlines.
The LTrim option can be present to remove left whitespace.
Variable references such as %MyVar% are expanded.
)
MsgBox % MyVariable

View file

@ -0,0 +1,8 @@
text1$ = " " + CHR$(10) + "<<'FOO' " + CHR$(10) + " 'jaja', `esto`" + CHR$(10) + " <simula>" + CHR$(10) + " \un\" + CHR$(10) + " ${ejemplo} de 'heredoc'" + CHR$(10) + " en QBASIC."
text2$ = "Esta es la primera línea." + CHR$(10) + "Esta es la segunda línea." + CHR$(10) + "Esta 'línea' contiene comillas."
PRINT text1$
PRINT
PRINT text2$
END

View file

@ -0,0 +1,8 @@
text1$ = " " & chr(10) & "<<#FOO# " & chr(10) & " #jaja#, `esto`" & chr(10) & " <simula>" & chr(10) & " \un\" & chr(10) & " ${ejemplo} de 'heredoc'" & chr(10) & " en BASIC256."
text2$ = "Esta es la primera linea." & chr(10) & "Esta es la segunda linea." & chr(10) & "Esta 'linea' contiene comillas."
print text1$
print
print text2$
end

View file

@ -0,0 +1,2 @@
•Out "dsdfsdfsad
""fsadf""sdf"

View file

@ -0,0 +1,2 @@
dsdfsdfsad
"fsadf"sdf

View file

@ -0,0 +1,8 @@
'--- we dont have a print here doc built-in command in BaCon
'--- we can get the end result like this with the newline NL$
PRINT "To use Bacon your system must have either Korn Shell, or ZShell, or Bourne Again Shell (BASH) available." NL$ \
"If none of these shells are available on your platform, download and install the free Public Domain Korn Shell which can" NL$ \
"execute BaCon also. Furthermore BaCon also works with a newer Kornshell implementation like the MirBSD Korn Shell." NL$ NL$ \
"BaCon intends to be a programming aid in creating tools which can be compiled on different platforms" NL$ \
"(including 64bit environments). It tries to revive the days of the good old BASIC." NL$

View file

@ -0,0 +1,4 @@
echo 'All strings
support
multiline
in Blade'

View file

@ -0,0 +1,10 @@
( {Multiline string:}
"
Second line
Third line
\"quoted\"
A backslash: \\
":?stringA
& out$("Multiline string:")
& out$(!stringA)
)

View file

@ -0,0 +1,18 @@
#include <iostream> // Only for cout to demonstrate
int main()
{
std::cout <<
R"EOF( A raw string begins with R, then a double-quote ("), then an optional
identifier (here I've used "EOF"), then an opening parenthesis ('('). If you
use an identifier, it cannot be longer than 16 characters, and it cannot
contain a space, either opening or closing parentheses, a backslash, a tab, a
vertical tab, a form feed, or a newline.
It ends with a closing parenthesis (')'), the identifer (if you used one),
and a double-quote.
All characters are okay in a raw string, no escape sequences are necessary
or recognized, and all whitespace is preserved.
)EOF";
}

View file

@ -0,0 +1,9 @@
#!/bin/csh -f
cat << ANARBITRARYTOKEN
* Your HOME is $HOME
* 2 + 2 is `@ n = 2 + 2; echo \$n`
ANARBITRARYTOKEN
cat << 'ANARBITRARYTOKEN'
$PATH \$PATH `shutdown now`
'ANARBITRARYTOKEN'

View file

@ -0,0 +1,13 @@
using System;
class Program
{
static void Main(string[] args)
{
Console.Write(@"
multiline
strings are easy
to put together
in C#");
}
}

View file

@ -0,0 +1,11 @@
myDoc = '''
Single-quoted heredocs allows no '#{foo}' interpolation.
This behavior is similar to single-quoted strings.
'''
doc2 = """
However, double-quoted heredocs *do* allow these.
See it in action:
Content: "#{myDoc}"
"""
console.log doc2

View file

@ -0,0 +1,10 @@
;; load cl-heredoc with QuickLisp
(ql:quickload 'cl-heredoc)
;; use #>xxx>yyyyyyyy!xxx as read-macro for heredoc
(set-dispatch-macro-character #\# #\> #'cl-heredoc:read-heredoc)
;; example:
(format t "~A~%" #>eof1>Write whatever (you) "want",
no matter how many lines or what characters until
the magic end sequence has been reached!eof1)

View file

@ -0,0 +1,6 @@
puts <<-DOC
this is a heredoc
it preserves indents and newlines
the DOC identifier is completely arbitrary
it can be lowercase, a keyword, or even a number (but not a float)
DOC

View file

@ -0,0 +1,21 @@
import std.stdio, std.string;
void main() {
// Delimited strings: a 'q' followed by double quotes and an
// opening and closing delimiter of choice:
q"[a string that you "don't" have to escape]"
.writeln;
// If the delimiter is an identifier, the identifier must be
// immediately followed by a newline, and the matching delimiter
// is the same identifier starting at the beginning of the line:
q"EOS
This
is a multi-line
heredoc string
EOS".outdent.writeln;
// std.string.outdent is used to remove the four spaces indent.
}

View file

@ -0,0 +1,4 @@
PrintLn("This is
a multiline
""string""
sample");

View file

@ -0,0 +1,4 @@
IO.puts """
привет
мир
"""

View file

@ -0,0 +1,2 @@
привет
мир

View file

@ -0,0 +1,11 @@
iex(1)> a=2
2
iex(2)> '''
...(2)> 1 + 1 = #{a}
...(2)> '''
'1 + 1 = 2\n'
iex(3)>
iex(3)> '''2'''
** (SyntaxError) iex:3: heredoc start must be followed by a new line after '''
iex(3)>

View file

@ -0,0 +1,7 @@
2> S = " ad
2> 123
2> the end".
3> io:fwrite( S ).
ad
123
the end

View file

@ -0,0 +1,11 @@
" a multiline
string\n(with escape sequences: \u{greek-capital-letter-sigma})
"
"""this is "easier".."""
HEREDOC: EOF
this
is not \n escaped at all
EOF

View file

@ -0,0 +1,49 @@
\ GForth specific words:
\ under+ ( a b c -- a+c b) , latest ( -- nt ) , name>string ( nt -- ca u )
\ Should not be a problem to modify it to work with other Forth implementation:
: $! ( ca u -- a )
dup >R dup , here swap move R> allot ;
: $@ ( a -- ca u )
dup @ 1 cells under+ ;
: c!+ ( c ca - ca+1 )
tuck c! 1+ ;
: $!+ ( a u a' -- a'+u ; string-store-plus )
2dup + >R swap move R> ;
\ --- UNIX end-of-line adapted words
10 constant EOL
: input-fix ( -- ; for interactive use ! )
source-id 0= IF cr THEN ;
: get_line ( -- ca u ) EOL parse input-fix ;
: EOL!+ ( a -- a' ; eol-store-plus ) EOL swap c!+ ;
: EOD ( -- ca u ; end-of-doc )
latest name>string ;
: >> ( "doc-name" "doc-body" -- ) input-fix
CREATE 0 , \ post body length
here dup >R
BEGIN refill >R
get_line 2dup EOD compare
R> AND \ notEOD && input-stream ->
WHILE rot $!+ EOL!+
REPEAT 2drop
R> tuck - dup allot
swap -1 cells + ! \ fixup body length
DOES> ( -- ca u ) $@ ;
\ TEST ; excerpt from Project Gutenberg 'Alice in Wonderland'
>> ALICE
CHAPTER I. Down the Rabbit-Hole
Alice was beginning to get very tired of sitting by her sister on the
bank, and of having nothing to do: once or twice she had peeped into the
book her sister was reading, but it had no pictures or conversations in
it, 'and what is the use of a book,' thought Alice 'without pictures or
conversation?'
ALICE
>> RABBIT
RABBIT
ALICE type ." --" cr RABBIT type

View file

@ -0,0 +1,28 @@
get-current get-order wordlist swap 1+ set-order definitions
: place over >r rot over cell+ r> move ! ;
: +place 2dup >r >r dup @ cell+ + swap move r> r> dup @ rot + swap ! ;
: count dup cell+ swap @ ;
set-current
CREATE eol 10 C, DOES> 1 ;
CREATE eod 128 ALLOT DOES> count ;
: seteod 0 parse ['] eod >body place ;
: start 0 0 here place ;
: read refill 0= IF abort" Unterminated here document" THEN ;
: ~end source eod compare ;
: store source here +place eol here +place ;
: slurp BEGIN read ~end WHILE store REPEAT refill drop ;
: totalsize here count + here - ;
: finish totalsize ALLOT align ;
: << seteod start slurp finish DOES> count ;
previous
( Test )
CREATE Alice << ~~ end ~~
They got a building down New York City, its called Whitehall Street,
Where you walk in, you get injected, inspected, detected, infected,
Neglected and selected.
~~ end ~~
Alice type bye

View file

@ -0,0 +1,17 @@
INTEGER I !A stepper.
CHARACTER*666 I AM !Sufficient space.
I AM = "<col72
C 111111111122222222223333333333444444444455555555556666666666
C 123456789012345678901234567890123456789012345678901234567890123456789
1 <col72
2 I AM <col72
3 <col72
4 THAT I AM <col72
5"
Chug through the text blob.
DO I = 0,600,66 !Known length.
WRITE (6,1) I AM(I + 1:I + 66) !Reveal one line.
1 FORMAT (A66) !No control characters are expected.
END DO !On to the next line.
END

View file

@ -0,0 +1,15 @@
Dim As String text1 = " " & Chr(10) & _
"<<'FOO' " & Chr(10) & _
" 'jaja', `esto`" & Chr(10) & _
" <simula>" & Chr(10) & _
" \un\" & Chr(10) & _
!" ${ejemplo} de \"heredoc\"" & Chr(10) & _
" en FreeBASIC."
Dim As String text2 = "Esta es la primera linea." & Chr(10) & _
"Esta es la segunda linea." & Chr(10) & _
!"Esta \"linea\" contiene comillas."
Print text1
Print Chr(10) + text2
Sleep

View file

@ -0,0 +1,3 @@
lyrics = """Oh, Danny Boy,
The pipes, the pipes are calling
From glen to glen and down the mountainside"""

View file

@ -0,0 +1,19 @@
[indent=4]
/*
Here documents, as template and verbatim strings in Genie
valac heredoc.gs
*/
init
test:string = "Genie string"
var multilineString = """
this is a $test
"""
var templateString = @"
this is a $test template
with math for six times seven = $(6 * 7)
"
stdout.printf("%s", multilineString)
stdout.printf("%s", templateString)

View file

@ -0,0 +1,3 @@
var m = ` leading spaces
and blank lines`

View file

@ -0,0 +1,8 @@
println '''
Time's a strange fellow;
more he gives than takes
(and he takes all) nor any marvel finds
quite disappearance but some keener makes
losing, gaining
--love! if a world ends
'''

View file

@ -0,0 +1,18 @@
def expired='defunct'
def horse='stallion'
def christ='Jesus'
println """
Buffalo Bill's
${expired}
who used to
ride a watersmooth-silver
${horse}
and break onetwothreefourfive pigeonsjustlikethat
${christ}
he was a handsome man
and what i want to know is
how do you like your blueeyed boy
Mister Death
"""

View file

@ -0,0 +1,16 @@
main :: IO ()
main = do
-- multiline String
putStrLn "Hello\
\ World!\n"
-- more haskell-ish way
putStrLn $ unwords ["This", "is", "an", "example", "text!\n"]
-- now with multiple lines
putStrLn $ unlines [
unwords ["This", "is", "the", "first" , "line."]
, unwords ["This", "is", "the", "second", "line."]
, unwords ["This", "is", "the", "third" , "line."]
]

View file

@ -0,0 +1,54 @@
here=:0 :0
0 :0 will be replaced by the text on the following lines.
This is three tokens: two instances of the number 0 and
one instance of the explicit definition token ':'.
Any indentation in the here document will be retained in the result.
There must be a space to the left of : or it will combine with the
0 on its left to form the token 0: which is something completely
different.
The here document is terminated by a line which contains only a
single right parenthesis ')' and optional white space. In J's
documentation the family of entities which include here documents
(and verb definitions and so on) are called 'scripts'.
When several scripts are referenced on the same line, they are used
sequentially in an order determined by their appearance on the line.
The leftmost 'script' reference gets the last script and the rightmost
reference gets the first script. But this is a rare usage.
Typically, such values are assigned a name so that they can be
used later. However, they may also be discarded and/or ignored, in
which case they are logically equivalent to multi-line comments.
)
and_here=:noun define
'noun define' is an alternative and perhaps more "user friendly"
way of declaring a here document. It achieves the same thing as
0 :0 and in fact 'noun' has the value 0 and 'define' has the value :0
And, of course, there must be a space between the word 'noun' and
the word 'define'.
Other useful alternatives include verb (which has the value 3)
and dyad (which has the value 4), and adverb (which has the value 1).
In other words 'verb define' (if unquoted) would be replaced by a
verb whose definition is provided in the following 'script'.
However, all of these names are normal variables which can
be declared to have different values by the developer. And, of course,
note that this mechanism is significantly more verbose than using
the underlying 0 :0 mechanism directly.
)
also_here=: {{)n
J902 introduced {{ blocks which may be {{ nested }} arbitrarily }} to
the J interpreter. This includes {{)n blocks which are here documents.
These {{)n blocks are not further nestable (they represent
literal text with no internal structure), and the terminating }}
must appear at the beginning of a line (or on the same line as
the opening {{)n -- but that would not be a "here doc").
If text does not appear after the )n on the initial line, the
initial (first) linefeed does not appear in the here doc. If
text follows the {{)n, that text (and optional newline) would
be included.
}}

View file

@ -0,0 +1,11 @@
package rosettacode.heredoc;
public class MainApp {
public static void main(String[] args) {
String hereDoc = """
This is a multiline string.
It includes all of this text,
but on separate lines in the code.
""";
System.out.println(hereDoc);
}
}

View file

@ -0,0 +1,6 @@
const myVar = 123;
const tempLit = `Here is some
multi-line string. And here is
the value of "myVar": ${myVar}
That's all.`;
console.log(tempLit)

View file

@ -0,0 +1,6 @@
def s:
"x
y
z";
s

View file

@ -0,0 +1,2 @@
$ jq -n s.jq
"x\ny\nz"

View file

@ -0,0 +1,6 @@
def specifier(a):
"x
\(a)
z";
specifier("y")

View file

@ -0,0 +1,7 @@
"a
tab: end
parens:()
single quotation mark:'
double quotation mark must be escaped:\"
b
d"

View file

@ -0,0 +1 @@
"a\ntab:\tend\nparens:()\nsingle quotation mark:'\ndouble quotation mark must be escaped:\"\nb\nd"

View file

@ -0,0 +1,5 @@
print("""\
Usage: thingy [OPTIONS]
-h Display this usage message
-H hostname Hostname to connect to
""")

View file

@ -0,0 +1,28 @@
// version 1.1.0
fun main(args: Array<String>) {
val ev = "embed variables"
val here = """
This is a raw string literal
which does not treat escaped characters
(\t, \b, \n, \r, \', \", \\, \$ and \u)
specially and can contain new lines,
indentation and other whitespace
within the string.
"Quotes" or doubled ""quotes"" can
be included without problem but not
tripled quotes.
It's also possible to $ev
in a raw string literal using string
interpolation.
If you need to include a
literal ${'$'} sign in a raw string literal then
don't worry you've just done it!
"""
println(here)
}

View file

@ -0,0 +1,15 @@
1) defining a variable:
{def myVar 123}
2) defining some text:
Here is some
multi-line string. And here is
the value of "myVar": '{myVar}
That's all.
3) displays :
Here is some
multi-line string. And here is
the value of "myVar": 123
That's all.

View file

@ -0,0 +1,4 @@
val .s = q:block END
We put our text here.
Here we are, Doc.
END

View file

@ -0,0 +1,4 @@
val .re = re:block END
a regex pattern here
Still here, Doc.
END

View file

@ -0,0 +1,4 @@
val .re = re:x:block END
a free-spacing regex pattern here
Somewhere, Doc.
END

View file

@ -0,0 +1,5 @@
str = "This is the first line.\
This is the second line.\
This "&QUOTE&"line"&QUOTE&" contains quotes."
put str

View file

@ -0,0 +1,2 @@
str = member("my long text").text
put str

View file

@ -0,0 +1,16 @@
print([[
This is a long paragraph of text
it is the simplest while using it
with lua, however it will have the
same line breaks and spacing as
you set in this block.
]])
print([=[by using equals signs, ]] may be embedded.]=])
local msg = [[this is a message that spans
multiple lines and will have the next lines
preserved as they were entered, so be careful
when using this]]
print(msg)

View file

@ -0,0 +1,8 @@
Module Checkit {
a$={This is the first line
This is the second line
End bracket position declare indentation fortext (except for first line)
}
Report a$ ' print all lines, without space at the left
}
CheckIt

View file

@ -0,0 +1,10 @@
sprintf('%s\n',...
'line1 text',...
' line2 text',...
' line3 text',...
' line4 text')
sprintf('%s\n',...
'Usage: thingy [OPTIONS]',...
' -h Display this usage message',...
' -H hostname Hostname to connect to')

View file

@ -0,0 +1,13 @@
Print["Mathematica
is an
interesing
language,
with its
strings
being
multiline
by\
default
when not
back\
s\\ashed!"];

View file

@ -0,0 +1,11 @@
; here-document.lsp
; oofoe 2012-01-19
; http://rosettacode.org/wiki/Here_document
(print (format [text]
Blast it %s! I'm a %s,
not a %s!
--- %s
[/text] "James" "magician" "doctor" "L. McCoy"))
(exit)

View file

@ -0,0 +1,4 @@
echo """Usage: thingy [OPTIONS]
-h Display this usage message
-H hostname Hostname to connect to
"""

View file

@ -0,0 +1,8 @@
print_string {whatever|
'hahah', `this`
<is>
\a\
"Heredoc" ${example}
in OCaml
|whatever}
;;

View file

@ -0,0 +1,6 @@
$address = <<<END
1, High Street,
$town_name,
West Midlands.
WM4 5HD.
END;

View file

@ -0,0 +1,5 @@
$x = <<<'FOO'
No
$interpolation
here
FOO;

View file

@ -0,0 +1,6 @@
$address = <<END;
1, High Street,
$town_name,
West Midlands.
WM4 5HD.
END

View file

@ -0,0 +1,5 @@
$pancake = <<"NO MORE INGREDIENTS";
egg
milk
flour
NO MORE INGREDIENTS

View file

@ -0,0 +1,5 @@
$x = <<'FOO';
No
$interpolation
here
FOO

View file

@ -0,0 +1,3 @@
$output = <<`BAR`;
ls /home
BAR

View file

@ -0,0 +1,4 @@
print(<<EOF . "lamb\n");
Mary had
a little
EOF

View file

@ -0,0 +1,7 @@
sub flibbertigibbet {
print <<~END;
Mary had
a little
lamb
END
}

View file

@ -0,0 +1,38 @@
string ts1 = """
this
"string"\thing"""
string ts2 = """this
"string"\thing"""
string ts3 = """
_____________this
"string"\thing"""
string ts4 = `
this
"string"\thing`
string ts5 = `this
"string"\thing`
string ts6 = `
_____________this
"string"\thing`
string ts7 = "this\n\"string\"\\thing"
constant tests={ts1,ts2,ts3,ts4,ts5,ts6,ts7}
for i=1 to length(tests) do
for j=1 to length(tests) do
if tests[i]!=tests[j] then crash("error") end if
end for
end for
printf(1,"""
____________Everything
(all %d tests)
works
just
file.""",length(tests))
printf(1,"""`""")
printf(1,`"""`)

View file

@ -0,0 +1,9 @@
(out "file.txt" # Write to "file.txt"
(prinl "### This is before the text ###")
(here "TEXT-END")
(prinl "### This is after the text ###") )
"There must be some way out of here", said the joker to the thief
"There's too much confusion, I can't get no relief"
TEXT-END
(in "file.txt" (echo)) # Show "file.txt"

View file

@ -0,0 +1,17 @@
$XMLdata=@"
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<servicing>
<package action="configure">
<assemblyIdentity name="Microsoft-Windows-Foundation-Package" version="${strFullVersion}" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />
<selection name="RemoteServerAdministrationTools" state="true" />
<selection name="RemoteServerAdministrationTools-Roles-AD" state="true" />
<selection name="RemoteServerAdministrationTools-Roles-AD-DS" state="true" />
<selection name="RemoteServerAdministrationTools-Roles-AD-DS-SnapIns" state="true" />
<selection name="RemoteServerAdministrationTools-Features-StorageManager" state="true" />
<selection name="RemoteServerAdministrationTools-Features-Wsrm" state="true" />
</package>
</servicing>
<cpi:offlineImage cpi:source="wim:d:/2008r2wim/install.wim#Windows Server 2008 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
"@

View file

@ -0,0 +1,5 @@
print("""\
Usage: thingy [OPTIONS]
-h Display this usage message
-H hostname Hostname to connect to
""")

View file

@ -0,0 +1,61 @@
/*REXX program demonstrates a method to use "here" documents in REXX. */
parse arg doc . /*"here" name is case sensitive. */
do j=1 for sourceline()
if sourceline(j)\==''doc then iterate
do !=j+1 to sourceline() while sourceline(!)\=='.'
say sourceline(!)
end /*!*/
exit /*stick a fork in it, we're done.*/
end /*j*/
say doc '"here" document not found.'
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────start of "here" docs──────────────────
rs-232
RS232 Signals and Pinouts
13 12 11 10 9 8 7 6 5 4 3 2 1
Interface between data 25 24 23 22 21 20 19 18 17 16 15 14
terminal equipment (DTE/male)
and data communication equipment
[DCE/female] employing serial
binary data interchange. 12secondary carrier detect [SCD] DCE
13secondary clear to send [SCS] DCE
1protective ground [PG, GND] 14secondary transmitted data [STD] DTE
2transmitted data [TD] DTE 15transmit clock [TC] DCE
3received data [RD] DCE 16secondary received data [SRD] DCE
4request to send [RTS] DTE 17receiver clock [RC] DCE
5clear to send [CTS] DCE 18unassigned
6data set ready [DSR] DCE 19secondary request to send [SRS] DTE
7signal ground [SG] 20data terminal ready [DTR] DTE
(common return) 21signal quality detector [SQD] DCE
8carrier detect [CD] DCE 22ring indicator [RI] DCE
9positive voltage [-] 23data rate select [DRS] DCE/DTE
10negative voltage [-] 24external clock [XTC] DTE
11unassigned 25unassigned
.
can
.
end of "here" docs*/

View file

@ -0,0 +1,8 @@
#lang racket/base
(displayln #<<EOF
Blah blah blah
with indentation intact
and "free" \punctuations\
EOF
)

View file

@ -0,0 +1,20 @@
#lang at-exp racket/base
(require scribble/text)
(define excited "!!!")
(define (shout . text) @list{>>> @text <<<})
(output
@list{Blah blah blah
with indentation intact
but respecting the indentation of
the whole code
and "free" \punctuations\
and even string interpolation-like @excited
but really @shout{any code}
})
(output @list|<<{And customizable delimiters
so @foo{} is just plain text}>>|)

View file

@ -0,0 +1,6 @@
my $color = 'green';
say qq :to 'END';
some line
color: $color
another line
END

View file

@ -0,0 +1,11 @@
my $contrived_example = 'Dylan';
sub freewheelin() {
print q :to 'QUOTE', '-- ', qq :to 'AUTHOR';
I'll let you be in my dream,
if I can be in yours.
QUOTE
Bob $contrived_example
AUTHOR
}
freewheelin;

View file

@ -0,0 +1,6 @@
my @a = <1 2 3 4>;
say Q :array :to 'EOH';
123 \n '"`
@a$bc
@a[]
EOH

View file

@ -0,0 +1,11 @@
'Buffy the Vampire Slayer' as sender
'Spike' as recipient
[
"Dear %(recipient)s,
"
"I wish you to leave Sunnydale and never return.
"
"Not Quite Love,
"%(sender)s
] "\n" join print

View file

@ -0,0 +1,11 @@
'Buffy the Vampire Slayer' as sender
'Spike' as recipient
group
"Dear %(recipient)s,
"
"I wish you to leave Sunnydale and never return.
"
"Not Quite Love,
%(sender)s\n"
list "\n" join print

View file

@ -0,0 +1,11 @@
text ="
<<'FOO'
Now
is
the
time
for
all
good mem
to come to the aid of their country."
see text + nl

View file

@ -0,0 +1,6 @@
address = <<END
1, High Street,
#{town_name},
West Midlands.
WM4 5HD.
END

View file

@ -0,0 +1,5 @@
pancake = <<"NO MORE INGREDIENTS"
egg
milk
flour
NO MORE INGREDIENTS

View file

@ -0,0 +1,5 @@
x = <<'FOO'
No
#{interpolation}
here
FOO

View file

@ -0,0 +1,3 @@
output = <<`BAR`
ls /home
BAR

View file

@ -0,0 +1,4 @@
puts <<EOF + "lamb"
Mary had
a little
EOF

View file

@ -0,0 +1,11 @@
text$ ="
<<'FOO'
Now
is
the
time
for
all
good mem
to come to the aid of their country."
print text$

View file

@ -0,0 +1,7 @@
let x = r#"
This is a "raw string literal," roughly equivalent to a heredoc.
"#;
let y = r##"
This string contains a #.
"##;

View file

@ -0,0 +1,3 @@
db2 "select 'This is the first line.
This is the second line.
This is the third line.' from sysibm.sysdummy1"

View file

@ -0,0 +1,3 @@
select 'This is the first line.' || chr(10) ||
'This is the second line.' || chr(10) ||
'This is the third line.' from sysibm.sysdummy1;

View file

@ -0,0 +1,5 @@
select 'This is the first line.' from sysibm.sysdummy1
union
select 'This is the second line.' from sysibm.sysdummy1
union
select 'This is the third line.' from sysibm.sysdummy1;

View file

@ -0,0 +1,4 @@
SET serveroutput ON
CALL DBMS_OUTPUT.PUT_LINE('This is the first line.' || chr(10) ||
'This is the second line.' || chr(10) ||
'This is the third line.');

View file

@ -0,0 +1,27 @@
object temp {
val MemoriesOfHolland=
"""Thinking of Holland
|I see broad rivers
|slowly chuntering
|through endless lowlands,
|rows of implausibly
|airy poplars
|standing like tall plumes
|against the horizon;
|and sunk in the unbounded
|vastness of space
|homesteads and boweries
|dotted across the land,
|copses, villages,
|couchant towers,
|churches and elm-trees,
|bound in one great unity.
|There the sky hangs low,
|and steadily the sun
|is smothered in a greyly
|iridescent smirr,
|and in every province
|the voice of water
|with its lapping disasters
|is feared and hearkened.""".stripMargin
}

View file

@ -0,0 +1,4 @@
c\
The commands 'a', 'c', and 'i' can be followed\
by multi-line text. Each line break in the text\
is preceded by a backslash.

View file

@ -0,0 +1,13 @@
set script to {{SCRIPT
put "Script demonstrating block quotes"
set text to {{
"I wish it need not have happened in my time," said Frodo.
"So do I," said Gandalf, "and so do all who live to see such times. But that is not for them to decide. All we have to decide is what to do with the time that is given us."
}}
put the number of occurrences of "time" in text --> 3
SCRIPT}}
do script

Some files were not shown because too many files have changed in this diff Show more