When Stream is a physical stream, it is closed, but all symbolic streams associated to it still refer to it until they are either closed as well or redirected to other physical streams. As long as there are some symbolic stream names associated to a physical stream, the physical stream cannot be reused for other communication channels.
When Stream is a symbolic stream name, it gets detached from the corresponding physical stream, and the physical stream is closed (unless it was already closed).
When an attempt is made to close a system stream, event 196 is raised. To close a physical stream connected with a system stream it is therefore advisable to redirect the system stream to another physical stream. Note however, that the default handler for the event 196 first resets all system streams connected to the physical stream to their defaults and then closes the physical stream. Attempts to close the default physical stream of a system stream are ignored.
Success: open(file1,write,s),write(s, a(b,c)),close(s). [eclipse]: open(junk, write, a), set_stream(b, a), get_stream(a, S). S = 5 yes. [eclipse]: close(a), open(junk1, write, X). X = 6 % 5 is not reused because b still points to it yes. [eclipse]: close(b), open(junk2, write, Y). Y = 5 % now 5 can be reused yes. Error: close(Stream). (Error 4). close("4"). (Error 5). close(10). (Error 172). close(nostream). (Error 193). close(null). (Error 196).