Skip to content

Commit d19d5cb

Browse files
committed
Rename Command object to Program.
1 parent 74746ce commit d19d5cb

8 files changed

+17
-17
lines changed

examples/sockets.ctr

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
?>
1515
<button data-id="knop">Click me</button><?. Pen brk.
1616

17-
Command flush.
17+
Program flush.
1818

1919
Application := Object new.
2020
Application on: 'run' do: {\
2121
{\ ^True. } whileTrue: {\
22-
var event := Command askQuestion.
22+
var event := Program waitForInput.
2323
listeners each: { key action |
2424
(key = event) ifTrue: {\
2525
action run.
@@ -29,6 +29,6 @@ Application on: 'run' do: {\
2929
}.
3030

3131
listeners := Map new.
32-
listeners put: {\ Pen write: 'CLICKED!', brk. Command flush. } at: 'clicked knop'.
32+
listeners put: {\ Pen write: 'CLICKED!', brk. Program flush. } at: 'clicked knop'.
3333

3434
Application run.

examples/storm.ctr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Request serverOption: 'minidle' is: 1, serverOption: 'maxidle' is: 2.
1414

1515
Request host:'localhost' listen:4000 pid:'/var/run/storm.pid' callback: {\
1616
Pen write: 'Content-type: text/html\n\n'.
17-
var fname := Command env: 'DOCUMENT_URI'.
17+
var fname := Program env: 'DOCUMENT_URI'.
1818
var script := File new: '/var/www/htdocs'+fname.
1919
script include.
2020
}.

tests/test0054.ctr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
(Command argCount) times: { i |
2-
((Command argument: i) != '-r') ifTrue: {\
3-
(((Command argument: i) indexOf: '.ast') > -1) ifTrue: {\
1+
(Program argCount) times: { i |
2+
((Program argument: i) != '-r') ifTrue: {\
3+
(((Program argument: i) indexOf: '.ast') > -1) ifTrue: {\
44
Pen write: 'Found argument file.'.
55
}.
6-
(((Command argument: i) indexOf: '.ctr') > -1) ifTrue: {\
6+
(((Program argument: i) indexOf: '.ctr') > -1) ifTrue: {\
77
Pen write: 'Found argument file.'.
88
}.
99
}.
1010
}.
11-
Pen write: (Command argument: 999).
11+
Pen write: (Program argument: 999).

tests/test0101.ctr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Command env: 'TSTVAR' val: 'Hello World!'.
2-
Pen write: 'value = ' + (Command env: 'TSTVAR').
1+
Program env: 'TSTVAR' val: 'Hello World!'.
2+
Pen write: 'value = ' + (Program env: 'TSTVAR').

tests/test0110.ctr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#Test exit statement
22
Pen write: 'Test the exit message'.
3-
Command exit.
3+
Program exit.
44
Pen write: 'Dont write this'.

tests/test0116.ctr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Command argument should segfault when out-of-bounds, issue#10
2-
wrong := Command argument: -10.
2+
wrong := Program argument: -10.
33
(wrong = Nil) ifTrue: {\
44
Pen write: 'I can handle out-of-bound Command arguments.\n'.
55
}, else: {\

tests/test0119.ctr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Test basic GET/POST support
2-
Command env: 'QUERY_STRING' val: 'search=table&restaurant=pizzaria&menu=spaghetti&menu=macaroni&course[main]=canneloni&course[dessert]=tiramisu'.
3-
Pen write: (Command env: 'QUERY_STRING'), brk.
2+
Program env: 'QUERY_STRING' val: 'search=table&restaurant=pizzaria&menu=spaghetti&menu=macaroni&course[main]=canneloni&course[dessert]=tiramisu'.
3+
Pen write: (Program env: 'QUERY_STRING'), brk.
44
s := Request get: 'search'.
55
Pen write: 'I was looking for a free '+s.
66
Pen write: ' in a '+(Request get: 'restaurant')+', ', brk.

world.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,10 @@ void ctr_initialize_world() {
671671
ctr_internal_create_func(CtrStdCommand, ctr_build_string("argCount", 8), &ctr_command_num_of_args);
672672
ctr_internal_create_func(CtrStdCommand, ctr_build_string("env:", 4), &ctr_command_get_env);
673673
ctr_internal_create_func(CtrStdCommand, ctr_build_string("env:val:", 8), &ctr_command_set_env);
674-
ctr_internal_create_func(CtrStdCommand, ctr_build_string("askQuestion", 11), &ctr_command_question);
674+
ctr_internal_create_func(CtrStdCommand, ctr_build_string("waitForInput", 12), &ctr_command_question);
675675
ctr_internal_create_func(CtrStdCommand, ctr_build_string("exit", 4), &ctr_command_exit);
676676
ctr_internal_create_func(CtrStdCommand, ctr_build_string("flush", 5), &ctr_command_flush);
677-
ctr_internal_object_add_property(CtrStdWorld, ctr_build_string("Command", 7), CtrStdCommand, 0);
677+
ctr_internal_object_add_property(CtrStdWorld, ctr_build_string("Program", 7), CtrStdCommand, 0);
678678
CtrStdCommand->link = CtrStdObject;
679679

680680
/* Clock */

0 commit comments

Comments
 (0)