4 using MalVal
= Mal
.types
.MalVal
;
7 class step1_read_print
{
9 static MalVal
READ(string str
) {
10 return reader
.read_str(str
);
14 static MalVal
EVAL(MalVal ast
, string env
) {
19 static string PRINT(MalVal exp
) {
20 return printer
._pr_str(exp
, true);
24 static void Main(string[] args
) {
25 Func
<string, MalVal
> RE
= (string str
) => EVAL(READ(str
), "");
27 if (args
.Length
> 0 && args
[0] == "--raw") {
28 Mal
.readline
.mode
= Mal
.readline
.Mode
.Raw
;
35 line
= Mal
.readline
.Readline("user> ");
36 if (line
== null) { break; }
37 if (line
== "") { continue; }
38 } catch (IOException e
) {
39 Console
.WriteLine("IOException: " + e
.Message
);
43 Console
.WriteLine(PRINT(RE(line
)));
44 } catch (Mal
.types
.MalContinue
) {
46 } catch (Exception e
) {
47 Console
.WriteLine("Error: " + e
.Message
);
48 Console
.WriteLine(e
.StackTrace
);