-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditionals.txt
70 lines (65 loc) · 2.59 KB
/
conditionals.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(doc not)
>> [b] Performs logical not.
(not true)
>> false
(not false)
>> true
(not 1)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'not', on line: 5:
java.lang.IllegalArgumentException: Expected parameter type: class java.lang.Boolean, but was: class java.math.BigInteger
(doc and)
>> [b+] Evaluates logical and.
(and)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'and', on line: 8:
java.lang.IllegalArgumentException: Expected number of parameters: 1+, but was: 0
(and true true true)
>> true
(and true true false)
>> true
(and 1)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'and', on line: 11:
java.lang.IllegalArgumentException: Expected parameter type: class java.lang.Boolean, but was: class java.math.BigInteger
(doc or)
>> [b+] Evaluates logical or.
(or)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'or', on line: 14:
java.lang.IllegalArgumentException: Expected number of parameters: 1+, but was: 0
(or true true true)
>> false
(or true true false)
>> false
(or 1)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'or', on line: 17:
java.lang.IllegalArgumentException: Expected parameter type: class java.lang.Boolean, but was: class java.math.BigInteger
(doc if)
>> [test true-branch false-branch] Evaluates test.
(if)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'if', on line: 20:
java.lang.IllegalArgumentException: Expected number of parameters: 3, but was: 0
(if true)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'if', on line: 21:
java.lang.IllegalArgumentException: Expected number of parameters: 3, but was: 1
(if true "T")
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'if', on line: 22:
java.lang.IllegalArgumentException: Expected number of parameters: 3, but was: 2
(if true "T" "F")
>> T
(if false "T" "F")
>> F
(if (not (= 1 1)) "T" "F")
>> F
(if nil "T" "F")
>> F
(doc cond)
>> [test true-branch]+ Evaluates tests. Returns the value of first true-branch where test is successful or nil.
(cond)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'cond', on line: 29:
java.lang.IllegalArgumentException: Expected number of parameters: 2+, but was: 0
(cond false "F")
>> nil
(cond false "F" true)
>> ERROR: cz.bh.lisp.LispException: Exception while evaluating function 'cond', on line: 31:
java.lang.IllegalArgumentException: Expected number of parameters is multiple of 2, but was: 3
(cond false "F" true "T")
>> T