2 import types
.Types
.MalType
;
6 class Step1_read_print
{
8 static function READ(str
:String
):MalType
{
9 return Reader
.read_str(str
);
13 static function EVAL(ast
:MalType
, env
:String
) {
18 static function PRINT(exp
:MalType
):String
{
19 return Printer
.pr_str(exp
, true);
23 static function rep(line
:String
) {
24 return PRINT(EVAL(READ(line
), ""));
27 public static function main() {
30 var line
= Compat
.readline("user> ");
31 if (line
== "") { continue; }
32 Compat
.println(rep(line
));
33 } catch (exc
:BlankLine
) {
35 } catch (exc
:haxe
.io
.Eof
) {
37 } catch (exc
:Dynamic) {
38 Compat
.println("Error: " + exc
);