Skip to content

Commit e9e6524

Browse files
committed
Settled on or: and and:
1 parent 3240db5 commit e9e6524

File tree

7 files changed

+12
-18
lines changed

7 files changed

+12
-18
lines changed

base.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ ctr_object* ctr_bool_either_or(ctr_object* myself, ctr_argument* argumentList) {
328328
*
329329
* Usage:
330330
*
331-
* a && b
331+
* a and: b
332332
*
333333
*/
334334
ctr_object* ctr_bool_and(ctr_object* myself, ctr_argument* argumentList) {
@@ -360,7 +360,7 @@ ctr_object* ctr_bool_nor(ctr_object* myself, ctr_argument* argumentList) {
360360
*
361361
* Usage:
362362
*
363-
* a || b
363+
* a or: b
364364
*/
365365
ctr_object* ctr_bool_or(ctr_object* myself, ctr_argument* argumentList) {
366366
ctr_object* other = ctr_internal_cast2bool(argumentList->object);

lexer.c

-6
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,6 @@ int ctr_clex_tok() {
180180
if (((char)*(ctr_code) == '!') && ((char)*(ctr_code+1)=='=')){
181181
ctr_code +=2; ctr_clex_tokvlen = 3; memcpy(ctr_clex_buffer, "≠", 3); return CTR_TOKEN_REF;
182182
}
183-
if (((char)*(ctr_code) == '|') && ((char)*(ctr_code+1)=='|')){
184-
ctr_code +=2; ctr_clex_tokvlen = 3; memcpy(ctr_clex_buffer, "∨", 3); return CTR_TOKEN_REF;
185-
}
186-
if (((char)*(ctr_code) == '&') && ((char)*(ctr_code+1)=='&')){
187-
ctr_code +=2; ctr_clex_tokvlen = 3; memcpy(ctr_clex_buffer, "∧", 3); return CTR_TOKEN_REF;
188-
}
189183
if (((char)*(ctr_code) == '<') && ((char)*(ctr_code+1)=='-')){
190184
ctr_code +=2; ctr_clex_tokvlen = 3; memcpy(ctr_clex_buffer, "←", 3); return CTR_TOKEN_REF;
191185
}

tests/test0027.ctr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pen write: 'Length is:' + 'ABCD' length.
22
x := 'ABCDE'.
33
Pen write: 'Length is:' + x length.
4-
(('ABC' length + 1 = 4) && (2!=3)) not not ifTrue: {\ Pen write: 'Yes'. }.
5-
(((3 > 4) || (4 > 2)) && (True xor: False) && (True xor: True) not) ifTrue: {\ Pen write: 'Yes'. }.
4+
(('ABC' length + 1 = 4) and: (2!=3)) not not ifTrue: {\ Pen write: 'Yes'. }.
5+
(((3 > 4) or: (4 > 2)) and: (True xor: False) and: (True xor: True) not) ifTrue: {\ Pen write: 'Yes'. }.
66
{\ Pen write: 'Running'. } run.

tests/test0053.ctr

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
(x < 3) ifFalse: {\ Pen write: 'FAIL'. }.
77
(x>-1) ifFalse: {\ Pen write: 'FAIL'. }.
88
x := ((Boolean flip) toNumber).
9-
(x = 0 || x = 1) ifFalse: {\ Pen write: 'FAIL'. }.
9+
(x = 0 or: x = 1) ifFalse: {\ Pen write: 'FAIL'. }.
1010
x := ((True flip) toNumber).
11-
(x = 0 || x = 1) ifFalse: {\ Pen write: 'FAIL'. }.
11+
(x = 0 or: x = 1) ifFalse: {\ Pen write: 'FAIL'. }.
1212
x := (Boolean flip either: 'HEAD' or: 'TAIL').
13-
(x = 'HEAD' || x = 'TAIL') ifFalse: {\ Pen write: 'FAIL'. }.
13+
(x = 'HEAD' or: x = 'TAIL') ifFalse: {\ Pen write: 'FAIL'. }.
1414
}.
1515
Pen write: 'DONE'.
1616

tests/test0062.ctr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ o on: 'hello' do: {\}.
55
{\ o on: 'test' do: 3.} catch: { e | Pen write: e, brk. }, run.
66
{\ o on: 'hello' do: {\}.} catch: { e | Pen write: e, brk. }, run. #allowed
77
{\ var z := 4 / 0. } catch: { e | Pen write: e, brk. }, run.
8-
{\ (True && Nil) ifTrue: {\ Pen write: 'X'.}. } catch: { e | Pen write: e, brk. }, run. #allowed
9-
{\ ('' || 0) ifTrue: {\ Pen write: 'X'.}. } catch: { e | Pen write: e, brk. }, run. #allowed
8+
{\ (True and: Nil) ifTrue: {\ Pen write: 'X'.}. } catch: { e | Pen write: e, brk. }, run. #allowed
9+
{\ ('' or: 0) ifTrue: {\ Pen write: 'X'.}. } catch: { e | Pen write: e, brk. }, run. #allowed
1010
{\ (1 < '2') ifTrue: {\ Pen write: 'OK'. }. } catch: { e | Pen write: e, brk. }, run. #allowed, cast
1111
{\ (1 < '2.0') ifTrue: {\ Pen write: 'OK'. }. } catch: { e | Pen write: e, brk. }, run. #allowed, cast
1212
{\ (1 < 'x2.0') ifTrue: {\ Pen write: 'NO!'. }. } catch: { e | Pen write: e, brk. }, run. #allowed, cast

tests/test0102.ctr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
motive := False.
33
opportunity := False.
44
Pen write: (motive nor: opportunity).
5-
Pen write: (motive not && opportunity not).
5+
Pen write: (motive not and: opportunity not).
66
#Test boolean equality messages
77
Pen write: (True == True).
88
Pen write: (True != True).

world.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,9 @@ void ctr_initialize_world() {
498498
ctr_internal_create_func(CtrStdBool, ctr_build_string("continue", 8), &ctr_bool_continue);
499499
ctr_internal_create_func(CtrStdBool, ctr_build_string("else:", 5), &ctr_bool_ifFalse);
500500
ctr_internal_create_func(CtrStdBool, ctr_build_string("not", 3), &ctr_bool_not);
501-
ctr_internal_create_func(CtrStdBool, ctr_build_string("", 3), &ctr_bool_and);
501+
ctr_internal_create_func(CtrStdBool, ctr_build_string("and:", 4), &ctr_bool_and);
502502
ctr_internal_create_func(CtrStdBool, ctr_build_string("nor:", 4), &ctr_bool_nor);
503-
ctr_internal_create_func(CtrStdBool, ctr_build_string("", 3), &ctr_bool_or);
503+
ctr_internal_create_func(CtrStdBool, ctr_build_string("or:", 3), &ctr_bool_or);
504504
ctr_internal_create_func(CtrStdBool, ctr_build_string("xor:", 4), &ctr_bool_xor);
505505
ctr_internal_create_func(CtrStdBool, ctr_build_string("=",1),&ctr_bool_eq);
506506
ctr_internal_create_func(CtrStdBool, ctr_build_string("≠",3),&ctr_bool_neq);

0 commit comments

Comments
 (0)