From: Mark Thom Date: Sat, 19 Nov 2022 01:19:29 +0000 (-0700) Subject: return -1 from get_code to indicate end of file (#1622) X-Git-Tag: v0.9.2~266 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=3bdcc3aba9eeae4ef32140c47be34f5022916d93;p=scryer-prolog.git return -1 from get_code to indicate end of file (#1622) --- diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index b154e266..f249f655 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -3058,11 +3058,10 @@ impl Machine { } if stream.at_end_of_stream() { - let end_of_file = atom!("end_of_file"); stream.set_past_end_of_stream(true); - self.machine_st.unify_atom( - end_of_file, + self.machine_st.unify_fixnum( + Fixnum::build_with(-1), self.machine_st.store(self.machine_st.deref(self.machine_st.registers[2])), );