darcsden :: alex -> the -> blob

the programming language

root / examples / boolean.the

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Bool = Object clone;
True = Object clone;
False = Object clone;

True delegates-to: Bool;
False delegates-to: Bool;

if: True  then: a else: _ = a do;
if: False then: _ else: b = b do;

if: True
    then: { "yep!" write }
    else: { "nope!" write };

if: False
    then: { "yep!" write }
    else: { "nope!" write };