Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Read table  





2 Read macros  





3 References  





4 Bibliography  














Lisp reader







Add links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


In the programming language Lisp, the readerorread function is the parser which converts the textual form of Lisp objects to the corresponding internal object structure.

In the original Lisp, S-expressions consisted only of symbols, integers, and the list constructors ( xi... ) and (x . y). Later Lisps, culminating in Common Lisp, added literals for floating-point, complex, and rational numbers, strings, and constructors for vectors.

The reader is responsible for parsing list structure, interning symbols, converting numbers to internal form, and calling read macros.

Read table

[edit]

The reader is controlled by the readtable, which defines the meaning of each character.

Read macros

[edit]

Unlike most programming languages, Lisp supports parse-time execution of programs, called "read macros" or "reader macros". These are used to extend the syntax either in universal or program-specific ways. For example, the quoted form (quote x) operator can be abbreviated as 'x. The ' operator can be defined as a read macro which reads the following list and wraps it with quote. Similarly, the backquote operator (` ) can be defined as a read macro.

References

[edit]

Bibliography

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Lisp_reader&oldid=758560757"

Categories: 
Lisp (programming language)
Parsing
 



This page was last edited on 6 January 2017, at 04:46 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki