Commit | Line | Data |
---|---|---|
2e3d457e VS |
1 | // @import readline.ck |
2 | ||
4abd73a6 VS |
3 | fun string READ(string input) |
4 | { | |
5 | return input; | |
6 | } | |
7 | ||
8 | fun string EVAL(string input) | |
9 | { | |
10 | return input; | |
11 | } | |
12 | ||
13 | fun string PRINT(string input) | |
14 | { | |
15 | return input; | |
16 | } | |
17 | ||
18 | fun string rep(string input) | |
19 | { | |
20 | return input => READ => EVAL => PRINT; | |
21 | } | |
22 | ||
23 | fun void main() | |
24 | { | |
2e3d457e | 25 | int done; |
4abd73a6 | 26 | |
2e3d457e | 27 | while( !done ) |
4abd73a6 | 28 | { |
2e3d457e VS |
29 | Readline.readline("user> ") => string input; |
30 | ||
31 | if( input != null ) | |
32 | { | |
33 | chout <= rep(input) + "\n"; | |
34 | } | |
35 | else | |
36 | { | |
37 | true => done; | |
38 | } | |
4abd73a6 VS |
39 | } |
40 | } | |
41 | ||
42 | main(); |