python: remove extraneous macroexpand call.
[jackhill/mal.git] / perl6 / step1_read_print.pl
CommitLineData
a7081401
HÖS
1use v6;
2use lib IO::Path.new($?FILE).dirname;
3use reader;
4use printer;
5use types;
6
7sub read ($str) {
8 return read_str($str);
9}
10
11sub eval ($ast) {
12 return $ast;
13}
14
15sub print ($exp) {
16 return pr_str($exp, True);
17}
18
19sub rep ($str) {
20 return print(eval(read($str)));
21}
22
23sub MAIN {
24 while (my $line = prompt 'user> ').defined {
25 say rep($line);
26 CATCH {
27 when X::MalException { .Str.say }
28 }
29 }
30}