mirror of
https://github.com/kanaka/mal.git
synced 2024-09-21 02:27:10 +03:00
a708140106
All tests pass, but readline support (via Linenoise module) is commented out in step0_repl.pl as it is not a core module. Should maybe change it when docker support is added.
28 lines
350 B
Raku
28 lines
350 B
Raku
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);
|
|
}
|
|
}
|