]> Repositorios git - scryer-prolog.git/commit
Fix set_output/1 and set_input/1 not updating the alias
authorEmilie Burgun <[email protected]>
Thu, 6 Feb 2025 21:55:40 +0000 (22:55 +0100)
committerEmilie Burgun <[email protected]>
Thu, 6 Feb 2025 22:01:38 +0000 (23:01 +0100)
commitd8213e29c5a4a2e628bd2e15400165bf3c3e1049
tree2ad58975d7a3d8ffb184df3a49d92c5f1fcd5b2e
parent7f2ce57ba77b68fe85fcc25bbf94f9450ad9cc9d
Fix set_output/1 and set_input/1 not updating the alias

Before this change, the following set of queries would behave incorrectly:

```
?- open("/tmp/out.log", write, S), set_output(S).
   prints(""), write("/tmp/out.log", "S = stream(...)").
?- write(user_output, hello).
   prints("hello"), unexpected.
   prints(""), write("/tmp/out.log", "hello"). % Expected, but not found.
```

Now, `set_output/1` and `set_input/1` properly bind the `user_output` and
`user_input` aliases, making the queries above behave as expected.
src/machine/system_calls.rs