3 with Ada
.IO_Exceptions
;
11 procedure Step3_Env
is
13 function Read
(Param
: String) return Types
.Mal_Handle
is
15 return Reader
.Read_Str
(Param
);
19 -- Eval can't be here because there are function pointers that point
20 -- at it. Thus it must be at library level. See evaluation.ads
23 function Print
(Param
: Types
.Mal_Handle
) return String is
25 return Printer
.Pr_Str
(Param
);
28 function Rep
(Param
: String) return String is
29 AST
, Evaluated_AST
: Types
.Mal_Handle
;
34 if Types
.Is_Null
(AST
) then
37 Evaluated_AST
:= Evaluation
.Eval
(AST
, Envs
.Get_Current
);
38 return Print
(Evaluated_AST
);
43 S
: String (1..Reader
.Max_Line_Len
);
48 if Ada
.Command_Line
.Argument_Count
> 0 then
49 if Ada
.Command_Line
.Argument
(1) = "-d" then
50 Evaluation
.Debug
:= True;
57 Ada
.Text_IO
.Put
("user> ");
58 Ada
.Text_IO
.Get_Line
(S
, Last
);
59 Ada
.Text_IO
.Put_Line
(Rep
(S
(1..Last
)));
63 when Ada
.IO_Exceptions
.End_Error
=> null;
64 -- i.e. exit without textual output