1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 00:52:44 +03:00
mal/perl6/step0_repl.pl

28 lines
350 B
Perl
Raw Normal View History

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);
}
}