Mercurial > repos > tabletprog
comparison samples/logical.tp @ 97:59a94f3ad56f
Added short-circuit && and || operators
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 26 Jul 2012 23:40:56 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
96:84b65ee8b78b | 97:59a94f3ad56f |
---|---|
1 #{ | |
2 | |
3 foo <- { | |
4 print: "foo\n" | |
5 true | |
6 } | |
7 | |
8 bar <- { | |
9 print: "bar\n" | |
10 false | |
11 } | |
12 | |
13 baz <- { | |
14 print: "baz\n" | |
15 true | |
16 } | |
17 | |
18 qux <- { | |
19 print: "shouldn't be printed\n" | |
20 true | |
21 } | |
22 | |
23 | |
24 main <- { | |
25 foo && bar || (baz || qux) | |
26 } | |
27 | |
28 } |