Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /smlnj-lib/branches/rt-transition/SExp/README
ViewVC logotype

Annotation of /smlnj-lib/branches/rt-transition/SExp/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4071 - (view) (download)

1 : jhr 4071 This library supports the reading and writing of structured data using
2 :     the S-expressions. It is a work in progress, and does not fully conform with
3 :     any formal S-exp specification. A few notes:
4 :    
5 :     - The negative sign is either "-" or "~"
6 :    
7 :     - Lists may be delimited by matched pairs of () [] or {}, nested freely.
8 :    
9 :     - List items are separated with [,;\ \t\n\r]. There are two other methods that
10 :     currently happen to work but are not supported and are _strongly_ discouraged:
11 :    
12 :     1. to use other characters (e.g., grave `) as delimiters,
13 :     2. to run in unambiguous sequences of tokens (e.g., (1"2") or (0x))
14 :    
15 :     - The format of a floating point number is
16 :     [+-]?[0-9]+\.[0-9]+([eE][0-9]+)?
17 :     Notably, "1." and ".1" are invalid and "1" is an integer---floats must have a
18 :     dot and it must have digits on both sides.
19 :    
20 :     - The entire input must parse to a single S-expression.
21 :    
22 :     - Symbols are either
23 :     '[^\ \t\n\r]+
24 :     or a string where the first has only characters from
25 :     [A-Z] | [a-z] | [-\^_/~!@$%&*\\:?.<>|+=']
26 :     and the rest can be any of the previous characters or a digit 0-9
27 :    
28 :     The difference between symbols and strings is that symbols are represented as
29 :     Atom.atom types, so equality comparisons are more efficient.
30 :    
31 :     Note that the leading-single-quote form of a symbol means that strings MUST
32 :     be double-quoted. The input 'foo' would be parsed as a symbol called foo'.
33 :    
34 :     - Please do not use # as a leading character for a symbol, as I may later add
35 :     support for individual characters in the format #"0xff".
36 :    
37 :     - Integers may be specified in decimal without any prefix, or in hexadecimal
38 :     with the prefix "0x". In hex, the value is assumed to be unsigned, so -255
39 :     should be written "-0xff" rather than "0x-ff".
40 :    
41 :     N.B. this means that printing the bytes of two's-complement signed integers
42 :     does not parse correctly: the output of `printf("%x", -1)` parses to INT_MIN.

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0