1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 01:57:09 +03:00

Java, Make: return nil from core readline function on EOF.

This commit is contained in:
Joel Martin 2014-05-10 15:46:15 -05:00
parent 70aff0c1fe
commit 92474a1bef
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ public class core {
} catch (IOException e) {
throw new MalException(new MalString(e.getMessage()));
} catch (readline.EOFException e) {
throw new MalException(new MalString(e.getMessage()));
return Nil;
}
}
};

View File

@ -60,7 +60,7 @@ str = $(call _string,$(call _pr_str_mult,$(1),,))
prn = $(info $(call _pr_str_mult,$(1),yes, ))
println = $(info $(subst \n,$(NEWLINE),$(call _pr_str_mult,$(1),, )))
readline= $(foreach res,$(call _string,$(call READLINE,"$(call str_decode,$($(1)_value))")),$(if $(READLINE_EOF),$(__nil),$(res)))
readline= $(foreach res,$(call _string,$(call READLINE,"$(call str_decode,$($(1)_value))")),$(if $(READLINE_EOF),$(eval READLINE_EOF :=)$(__nil),$(res)))
read_str= $(call READ_STR,$(1))
slurp = $(call _string,$(call _read_file,$(call str_decode,$($(1)_value))))