Merge pull request #273 from wasamasa/r7rs-implementation
[jackhill/mal.git] / dart / step0_repl.dart
CommitLineData
3934e3f8
HT
1import 'dart:io';
2
3String READ(String x) => x;
4
5String EVAL(String x) => x;
6
7String PRINT(String x) => x;
8
9String rep(String x) => PRINT(EVAL(READ(x)));
10
11const prompt = 'user> ';
12main() {
13 while (true) {
14 stdout.write(prompt);
15 var input = stdin.readLineSync();
16 if (input == null) return;
17 var output = rep(input);
18 stdout.writeln(output);
19 }
20}