Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Serialization
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Prolog=== [[Prolog]]'s ''term'' structure, which is the only data structure of the language, can be serialized out through the built-in predicate <code>write_term/3</code> and serialized-in through the built-in predicates <code>read/1</code> and <code>read_term/2</code>. The resulting stream is uncompressed text (in some encoding determined by configuration of the target stream), with any free variables in the term represented by placeholder variable names. The predicate <code>write_term/3</code> is standardized in the [[Prolog#ISO Prolog|ISO Specification for Prolog]] (ISO/IEC 13211-1) on pages 59 ff. ("Writing a term, Β§ 7.10.5"). Therefore it is expected that terms serialized-out by one implementation can be serialized-in by another without ambiguity or surprises. In practice, implementation-specific extensions (e.g. SWI-Prolog's dictionaries) may use non-standard term structures, so interoperability may break in edge cases. As examples, see the corresponding manual pages for SWI-Prolog,<ref>{{cite web|url=https://www.swi-prolog.org/pldoc/man?section=termrw|title="Term reading and writing"|website=www.swi-prolog.org}}</ref> SICStus Prolog,<ref>{{cite web|url=https://sicstus.sics.se/sicstus/docs/latest4/html/sicstus.html/mpg_002dref_002dwrite_005fterm.html#mpg_002dref_002dwrite_005fterm|title="write_term/[2,3]"|website=sicstus.sics.se}}</ref> GNU Prolog.<ref>{{cite web|url=http://gprolog.org/manual/html_node/gprolog038.html|title="Term input/output"|website=gprolog.org}}</ref> Whether and how serialized terms received over the network are checked against a specification (after deserialization from the character stream has happened) is left to the implementer. Prolog's built-in [[Prolog syntax and semantics#Definite clause grammars|Definite Clause Grammars]] can be applied at that stage.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)