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,18 @@
/* NetRexx */
options replace format comments java crossref savelog symbols nobinary
bval = [1, 0, 5, 'a', 1 == 1, 1 \= 1, isTrue, isFalse]
loop b_ = 0 for bval.length
select case bval[b_]
when isTrue then say bval[b_] 'is true'
when isFalse then say bval[b_] 'is false'
otherwise say bval[b_] 'is not boolean'
end
end b_
method isTrue public static returns boolean
return (1 == 1)
method isFalse public static returns boolean
return \isTrue

View file

@ -0,0 +1 @@
type bool = false | true

View file

@ -0,0 +1 @@
true is '1'b and false is '0'b

View file

@ -0,0 +1,3 @@
var
pInt : ^integer ;
ValidP : boolean ;

View file

@ -0,0 +1 @@
if pInt then ...

View file

@ -0,0 +1 @@
if pInt^ then ...

View file

@ -0,0 +1 @@
if not(pInt = nil) then ValidP := true ;

View file

@ -0,0 +1 @@
if ( ValidP ) and (pInt^ <> 0) then ...

View file

@ -0,0 +1,2 @@
my Bool $crashed = False;
my $val = 0 but True;

View file

@ -0,0 +1,13 @@
> 0;
(3) Result: 0
> false;
(4) Result: 0
> 0;
(6) Result: 0
> !true;
(7) Result: 0
> true;
(8) Result: 1
> 1;
(9) Result: 1
>

View file

@ -0,0 +1,2 @@
true
false

View file

@ -0,0 +1,5 @@
DIM x AS LONG
x = ISTRUE(1 = 1) ' returns -1
x = ISTRUE(1 = 0) ' returns 0
x = ISFALSE(1 = 1) ' returns 0
x = ISFALSE(1 = 0) ' returns -1

View file

@ -0,0 +1,2 @@
$true
$false

View file

@ -0,0 +1,6 @@
if 1 then print "1 is true"
if not(0) then print "0 is false"
if 1 < 2 then print "1 < 2 TRUE"
if 2 > 1 then print "2 > 1 TRUE"
if not(2 < 1) then print "2 not < 1"
if not(1 = 0) then print "1 not = 0"

View file

@ -0,0 +1 @@
datatype bool = false | true

View file

@ -0,0 +1,8 @@
if
echo 'Looking for file' # This is the evaluation block
test -e foobar.fil # The exit code from this statement determines whether the branch runs
then
echo 'The file exists' # This is the optional branch
echo 'I am going to delete it'
rm foobar.fil
fi

View file

@ -0,0 +1 @@
true && echo "true" || echo "false"

View file

@ -0,0 +1,3 @@
Dim x As Boolean
x = IIf(Int(Rnd * 2), True, False)
MsgBox x

View file

@ -0,0 +1,9 @@
<xsl:if test="true() or false()">
True and false are returned by built-in XPath functions.
</xsl:if>
<xsl:if test="@myAttribute='true'">
Node attributes set to "true" or "false" are just strings. Use string comparison to convert them to booleans.
</xsl:if>
<xsl:if test="@myAttribute or not($nodeSet)">
Test an attribute for its presence (empty or not), or whether a node set is empty.
</xsl:if>