资 源 简 介
S-expressions are a versatile and light weight approach to structured data representation. Data are represented in atoms and structured in lists. Atoms can hold arbitrary data without escaping or any other transformation. S-expressions are a superior choice to XML for non-markup applications (which are most XML applications!).
This implementation is inspired by R. Rivest"s proposal: http://people.csail.mit.edu/rivest/Sexp.txt]
Here"s an example
[a "b" 3:abc ["more stuff" 12:goes in here]]
A well formed s-expression is a list. Inside the above list we first see three atoms.
The first is a token, the second is a literal C style string, and the third is a length-prefixed string. Length prefixed atoms allow arbitrary binary data and thus provide a huge win for efficiency of space and time in data storage and transmission. The fourth item is a list containing two tokens (the prefix "12" captures the string "goes in her