mirror of
https://github.com/kanaka/mal.git
synced 2024-11-11 00:52:44 +03:00
28 lines
350 B
Perl
28 lines
350 B
Perl
|
use v6;
|
||
|
#use Linenoise;
|
||
|
|
||
|
sub read ($str) {
|
||
|
return $str;
|
||
|
}
|
||
|
|
||
|
sub eval ($ast) {
|
||
|
return $ast;
|
||
|
}
|
||
|
|
||
|
sub print ($exp) {
|
||
|
return $exp;
|
||
|
}
|
||
|
|
||
|
sub rep ($str) {
|
||
|
return print(eval(read($str)));
|
||
|
}
|
||
|
|
||
|
sub MAIN {
|
||
|
#while (my $line = linenoise('user> ')).defined {
|
||
|
# say rep($line);
|
||
|
#}
|
||
|
while (my $line = prompt 'user> ').defined {
|
||
|
say rep($line);
|
||
|
}
|
||
|
}
|