1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 02:27:10 +03:00
mal/yorick/step0_repl.i
2017-09-22 21:16:55 +00:00

34 lines
409 B
OpenEdge ABL

func READ(str)
{
return str
}
func EVAL(exp, env)
{
return exp
}
func PRINT(exp)
{
return exp
}
func REP(str)
{
return PRINT(EVAL(READ(str), ""))
}
func main(void)
{
stdin_file = open("/dev/stdin", "r")
while (1) {
write, format="%s", "user> "
line = rdline(stdin_file, prompt="")
if (!line) break
if (strlen(line) > 0) write, format="%s\n", REP(line)
}
write, ""
}
main;