langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,2 @@
# 'a';;
- : char = 'a'

View file

@ -0,0 +1,2 @@
# "Hello world";;
- : string = "Hello world"

View file

@ -0,0 +1,3 @@
# "abc\
def";;
- : string = "abcdef"

View file

@ -0,0 +1,3 @@
# "abc
def";;
- : string = "abc\n def"

View file

@ -0,0 +1 @@
@"Hello, world!"

View file

@ -0,0 +1,5 @@
s1 = 'abcd' % simple string
s2 = 'ab''cd' % string containing a single quote using an escaped single quote
s3 = 'ab"cd' % simple string containing a double quote
s4 = "ab'cd" % string containing a single quote
s5 = "ab""cd" % string containing a double quote using an escaped double quote

View file

@ -0,0 +1,15 @@
declare
Digit0 = &0 %% the character '0'
NewLine = &\n %% a character with special representation
NewLine = &\012 %% characters can also be specified with octals
%% Strings are lists of characters, but can also be written in double quotes:
[&H &e &l &l &o] = "Hello"
AnAtom = 'Hello' %% single quotes are used for atoms
Atom2 = hello = 'hello' %% for atoms starting with a lower case letter, they are optional
%% To build strings out of other values, so-called virtual strings are used:
MyName = "Peter"
MyAge = 8
{System.showInfo MyName # " is " # MyAge # " years old."}

View file

@ -0,0 +1,6 @@
'H' /* a single character as a literal. */
'this is a string'
'' /* an empty string literal. */
'John''s cat' /* a literal containing an embedded apostrophe. */
/* stored are <<John's cat>> */
'101100'b /* a bit string, stored as one bit per digit. */

View file

@ -0,0 +1 @@
my $raw = Q'$@\@#)&!#';

View file

@ -0,0 +1,3 @@
say qq:to/END/;
Your ad here.
END

View file

@ -0,0 +1,15 @@
"\a" # BELL
"\b" # BACKSPACE
"\t" # TAB
"\n" # LINE FEED
"\f" # FORM FEED
"\r" # CARRIAGE RETURN
"\e" # ESCAPE
"\x263a" # ☺
"\o40" # SPACE
"\0" # NULL
"\cC" # CTRL-C
"\c8" # BACKSPACE
"\c[13,10]" # CRLF
"\c[LATIN CAPITAL LETTER A, COMBINING RING ABOVE]"

View file

@ -0,0 +1,7 @@
'c'; // Character code (ASCII) (result: 99)
"c"; // String (result: "c")
"\n"; // String (result: newline character)
"hi " + world // String (result: "hi " and the contents of the variable world)
#"multiple line
string using the
preprocessor" // single literal string with newlines in it

View file

@ -0,0 +1 @@
'a' ;;; string consisting of single character

View file

@ -0,0 +1 @@
'\'\n' ;;; string consisting of quote and newline

View file

@ -0,0 +1,16 @@
; Characters (*.c), can be ASCII or UNICODE depending on compiler setting
Define.c AChar='A'
; defines as *.a it will be ASCII and *.u is always UNICODE
Define.a A='b'
Define.u U='水'
; Strings is defined as **.s or ending with '$'
Define.s AStrion ="String #1"
Define BStrion.s ="String #2"
Define CString$ ="String #3"
; Fixed length stings can be defined if needed
Define XString.s{100} ="I am 100 char long!"
; '"' can be included via CHR() or its predefined constant
Define AStringQuotes$=Chr(34)+"Buu"+Chr(34)+" said the ghost!"
Define BStringQuotes$=#DOUBLEQUOTE$+"Buu"+#DOUBLEQUOTE$+" said yet a ghost!"

View file

@ -0,0 +1,6 @@
Select StringByteLength("X")
Case 1
Print("ASCII-mode; Soo, Hello world!")
Case 2
Print("UNICODE-mode; Soo, 您好世界!")
EndSelect

View file

@ -0,0 +1,2 @@
'c
"hello, world!"

View file

@ -0,0 +1 @@
var char: ch is 'z';

View file

@ -0,0 +1 @@
var string: stri is "hello";

View file

@ -0,0 +1,3 @@
var string: example is "this is a string\
\ which continues in the next line\n\
\and contains a line break";

View file

@ -0,0 +1,6 @@
$a
$D
$8
$,
$\s
$\n

View file

@ -0,0 +1 @@
'Hello\'s the word.'

View file

@ -0,0 +1,2 @@
- #"a";
val it = #"a" : char

View file

@ -0,0 +1,2 @@
- "Hello world";
val it = "Hello world" : string

View file

@ -0,0 +1,3 @@
- "abc\
\def";
val it = "abcdef" : string

View file

@ -0,0 +1,12 @@
$$ MODE TUSCRIPT,{}
s1=*
DATA "string"
s2=*
DATA + "double" quotes
s3=*
DATA + 'single' quotes
s4=*
DATA + "double" + 'single' quotes
show=JOIN(s1," ",s2,s3,s4)
show=JOIN(show)
PRINT show

View file

@ -0,0 +1,2 @@
echo "The boy said 'hello'."
echo 'The girl said "hello" too.'

View file

@ -0,0 +1 @@
print "The man said \"hello\".";

View file

@ -0,0 +1,6 @@
cat << END
1, High Street,
SMALLTOWN,
West Midlands.
WM4 5HD.
END

View file

@ -0,0 +1 @@
a = `x

View file

@ -0,0 +1 @@
cr = 13%cOi&

View file

@ -0,0 +1 @@
b = 'a string'

View file

@ -0,0 +1 @@
c = 'Hobson''s choice'

View file

@ -0,0 +1,4 @@
d =
-[this is a list
of strings]-

View file

@ -0,0 +1,3 @@
e = -[the front matter -[ d ]- the rest of it]-
f = -[text -[ d ]- more -[ e ]- text ]-

View file

@ -0,0 +1 @@
g "x" = -[ Dear -[ "x" ]- bla bla ]-

View file

@ -0,0 +1 @@
'hello world' puts

View file

@ -0,0 +1,2 @@
Dim s = "Tom said, ""The fox ran away."""
Result: Tom said, "The fox ran away."

View file

@ -0,0 +1 @@
<xsl:if test="starts-with(@name, 'Mr.')">Mister</xsl:if>