| Did you know ... | Search Documentation: |
| Predicate read_term/2 |
true, read `...` to a string
object (see
section 5.2). The default
depends on the Prolog flag
back_quotes.\ escape sequences in quoted atoms. See
the Prolog flag character_escapes
in current_prolog_flag/2.
(SWI-Prolog).true (default false), re-instantiate
templates as produced by the corresponding write_term/2
option. Note that the default is false to avoid
misinterpretation of @(Template, Substitutions), while the
default of write_term/2
is true because emitting cyclic terms without using the
template construct produces an infinitely large term (read: it will
generate an error after producing a huge amount of output).true (default false), read .(a,[])
as a list, even if lists are internally constructed a different functor
([|](Head,Tail)). This is primarily intended to read the
output from write_canonical/1
from other Prolog systems. See
section 5.1.user is used because new modules by
default inherit from userquasi_quotation(+Syntax,
+Quotation, +VarDict, -Result), where Syntax is the
term in
{|Syntax||..|}, Quotation is a list of character
codes that represent the quotation, VarDict is a list of
Name=Variable and Result is a variable
that shares with the place where the quotation must be inserted. This
option is intended to support tools that manipulate Prolog source text.variable_names, but only reports the variables occurring
only once in the Term read (ISO). If Vars is the
constant
warning, singleton variables are reported using print_message/2.
The variables appear in the order they have been read. The latter option
provides backward compatibility and is used to read terms from source
files. Not all singleton variables are reported as a warning. See
section 2.15.1.10
for the rules that apply for warning about a singleton variable.113As
of version 7.7.17, all variables starting with an underscore
except for the truly anonymous variable are returned in Vars.
Older versions only reported those that would have been reported if warning
is used.error (default), throw an exception on a syntax error.
Other values are fail, which causes a message to be printed
using
print_message/2,
after which the predicate fails, quiet which causes the
predicate to fail silently, and dec10 which causes syntax
errors to be printed, after which read_term/[2,3]
continues reading the next term. Using dec10, read_term/[2,3]
never fails. (Quintus, SICStus).").{...}, as used in DCG rules. Arg
describes the argument.|<TailTerm>, Tail
is unified with the term position of the tail, otherwise with the atom none.key_value_position/7 terms. The
key_value_position/7 terms appear in the order of the
input. Because maps do not preserve ordering, the key is provided in the
position description.term_position/5 that would
be created, except that the key and value positions do not need an
intermediate list and the key is provided in Key to enable
synchronisation of the file position data with the data structure.{|Syntax||Content|},
SyntaxTerm is the parsed term representation from Syntax,
e.g., {|string(X)||Hello {{X}}|} produces Syntax
string(X) and SyntaxPos describes the layout of
this term. ContentPos is always a term From-To
describing the character range of Content.114The
layout of the term produced by the quasi quotation parser is not
available. Future versions may provide an interface that allows
contributing a layout term.true, demand variables to start with an underscore. See
section 2.15.1.8.unicode_atoms option, or the
unicode_atoms
flag), library(unicode) is loaded automatically. If the
library is unavailable the underlying
use_module/1
call propagates its
existence_error(source_sink, library(unicode)).syntax_error(non_nfc_atom) when an unquoted atom
contains text that is not in NFC. Uses the kernel hook for an exact NFC
test when library(unicode) is loaded; otherwise falls back
to rejecting any code point with wcwidth less than 1 (combining
marks, zero-width and non-printable characters), which is conservative
but accurate enough for source-code review.syntax_error(non_ascii_atom) when an unquoted atom
contains any non-ASCII code point. Independent of library(unicode).
Quoted atoms and string literals are always byte-faithful, regardless
of the mode. This is the canonical description of the four values; the
same vocabulary applies to the Prolog flag
unicode_atoms, set_stream/2,
the unicode_atoms option of open/4,
and the unicode_atoms property of
stream_property/2.