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!
===Lisp=== Generally a [[Lisp (programming language)|Lisp]] data structure can be serialized with the functions "<code>read</code>" and "<code>print</code>". A variable foo containing, for example, a list of arrays would be printed by <code>(print foo)</code>. Similarly an object can be read from a stream named s by <code>(read s)</code>. These two parts of the Lisp implementation are called the Printer and the Reader. The output of "<code>print</code>" is human readable; it uses lists demarked by parentheses, for example: {{code|(4 2.9 "x" y)|lisp}}. In many types of Lisp, including [[Common Lisp]], the printer cannot represent every type of data because it is not clear how to do so. In Common Lisp for example the printer cannot print CLOS objects. Instead the programmer may write a method on the generic function <code>print-object</code>, this will be invoked when the object is printed. This is somewhat similar to the method used in Ruby. Lisp code itself is written in the syntax of the reader, called read syntax. Most languages use separate and different parsers to deal with code and data, Lisp only uses one. A file containing lisp code may be read into memory as a data structure, transformed by another program, then possibly executed or written out, such as in a [[read–eval–print loop]]. Not all readers/writers support cyclic, recursive or shared structures.
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)