1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00
mal/impls/dart/step0_repl.dart

21 lines
363 B
Dart
Raw Normal View History

2016-11-14 01:21:44 +03:00
import 'dart:io';
String READ(String x) => x;
String EVAL(String x) => x;
String PRINT(String x) => x;
String rep(String x) => PRINT(EVAL(READ(x)));
const prompt = 'user> ';
main() {
while (true) {
stdout.write(prompt);
var input = stdin.readLineSync();
if (input == null) return;
var output = rep(input);
stdout.writeln(output);
}
}