This built-in predicate outputs a list of terms to the current output stream. The output stream must be a text stream that was opened for writing or appending data. See write/1 for information about how the terms are written to the stream. The second parameter is called to seperate each item in the list, i.e. after writing the first element in the list the body_term is called, then again after the second, etc., but not after the last element in the list.
see also: char_conversion/2 current_char_conversion/2 current_op/3 op/3 read/1 read/2 read_term/2 read_term/3 write/1 write/2 write_canonical/1 write_canonical/2 write_list/1 write_list/2 write_list_goal/3 write_term/2 write_term/3 writeq/1 writeq/2
| Example | |
| write_list_goal(['Value:' , X], nl). | succeeds and writes the text 'Value:' to the current output stream, then a newline character is written because nl/0 is called and then the value of X was written |
| Exceptions | |
| the current output stream is associated with a binary stream | a permission_error(output, binary_stream, OS) is thrown and OS is substituted by the current binary stream |
| the body_term argument is an empty variable | an instantiation_error exception is thrown |