;;; -*- Mode:gate; Fonts:(HL12 HL12I HL12B CPTFONTB HL12BI HL12B HL12I ) -*- =Node: 4What The Reader Accepts* =Text: 3WHAT THE READER ACCEPTS* The purpose of the reader is to accept characters, interpret them as the p.r. of a Lisp object, and create and return such an object. The reader cannot accept everything that the printer produces; for example, the p.r.'s of compiled code objects, closures, stack groups, etc., cannot be read in. However, it has many features that are not seen in the printer at all, such as more flexibility, comments, and convenient abbreviations for frequently-used unwieldy constructs. This section shows what kind of p.r.'s the reader understands, and explains the readtable, reader macros, and various features provided by 2read*. The syntax specified for Common Lisp is incompatible with the traditional Zetalisp syntax. Therefore, the Lisp Machine supports both traditional and Common Lisp syntax, but 2read* must be told in advance which one to use. This is controlled by the choice of readtable (see 4(READPRINT-4)The Readtable*). When reading input from a file, the Lisp system chooses the syntax according to the file's attribute list: Common Lisp syntax is used if the 2Common Lisp* attribute is present (see 4(FILEACCESS-2)File Attribute Lists*). The main difference between traditional and Common Lisp syntax is that traditionally the single-character escape is slash (2/*), whereas in Common Lisp syntax it is backslash (2\*). Thus, the division function which in traditional syntax is written 2//* is written just 2/* in Common Lisp syntax. The other differences are obscure and are mentioned below where they occur. In general, the reader operates by recognizing tokens in the input stream. Tokens can be self-delimiting or can be separated by delimiters such as whitespace. A token is the p.r. of an atomic object such as a symbol or number, or a special character such as a parenthesis. The reader reads one or more tokens until the complete p.r. of an object has been seen, then constructs and returns that object. 1Escape characters* can be used to suppress the special syntactic significance of any character, including 2:*, 2Space*, 2(* or 2"*. There are two kinds of escape character: the 1single-character escape* (2/* in traditional syntax, 2\* in Common Lisp syntax) suppresses the significance of the immediately following character; 1multiple escapes* (vertical bar, 2|*) are used in pairs, and suppress the special significance of all the characters except escapes between the pair. Escaping a character causes it to be treated as a token constituent and causes the token containing it to be read as a symbol. For example, 2(12 5 x)* represents a list of three elements, two of which are integers, but 2(/12 5/ x)* or 2(|15| |5 X|)* represents a list of two elements, both symbols. Escaping also prevents conversion of letters to upper case, so that 2|x|* is the symbol whose print name contains a lower-case 2x*. The circle-cross (3*) character an 1octal escape character* which may be useful for including weird characters in the input. The next three characters are read and interpreted as an octal number, and the character whose code is that number replaces the circle-cross and the digits in the input stream. This character is always treated as a token constituent and forces the token to be read as a symbol. 3* is allowed in both traditional and Common Lisp syntax, but it is not valid Common Lisp. Integers: The reader understands the p.r.'s of integers in a way more general than is employed by the printer. Here is a complete description of the format for integers. Let a 1simple integer* be a string of digits, optionally preceded by a plus sign or a minus sign, and optionally followed by a trailing decimal point. A simple integer is interpreted by 2read* as an integer. If the trailing decimal point is present, the digits are interpreted in decimal radix; otherwise, they are considered as a number whose radix is the value of the variable 2*read-base**. 3*read-base** 1Variable* 3ibase* 1Variable* The value of 2ibase* or 2*read-base** is an integer between 2 and 36 that is the radix in which integers and ratios are read. The initial value of is ten. For input from files or editor buffers, the 2Base* attribute specifies the value to be used (see 4(FILEACCESS-2)File Attribute Lists*); if it is not given, the ambient value is used. The synonym 2ibase* is from Maclisp. If the input radix is greater than ten, letters starting with 2a* are used as additional ``digits'' with values ten and above. For example, in radix 16, the letters 2a* through 2f* are digits with values ten through 15. Alphabetic case is not significant. These additional digits can be used wherever a simple integer is expected and are parsed using the current input radix. For example, if 2*read-base** is 16 then 3ff* is recognized as an integer (255 decimal). So is 210e5*, which is a float when 2*read-base** is ten. Traditional syntax also permits a simple integer, followed by an underscore (2_*) or a circumflex (2^*), followed by another simple integer. The two simple integers are interpreted in the usual way; the character in between indicates an operation that is then performed on the two integers. The underscore indicates a binary ``left shift''; that is, the integer to its left is doubled the number of times indicated by the integer to its right. The circumflex multiplies the integer to its left by 2*read-base** the number of times indicated by the integer to its right. (The second simple integer is not allowed to have a leading minus sign.) Examples: 23_2* means 212* and 2645^3* means 2645000*. Here are some examples of valid representations of integers to be given to 2read*: 34* 323456.* 3-546* 3+45^+6 ;2means* 45000000* 32_11 ;4096* 372361356126536125376512375126535123712635* 3-123456789.* 3105_1000 ;(ash 105 1000) has this value.* 3105_1000.* Floating Point Numbers: Floats can be written with or without exponent. The syntax for a float without exponent is an optional plus or minus sign, optionally some digits, a decimal point, and one or more digits. A float with exponent consists of a simple integer or a float without exponent, followed by an exponent delimiter (a letter) and a simple integer (the exponent itself) which is the power of ten by which the number is to be scaled. The exponent may not have a trailing decimal point. Both the mantissa and the exponent are always interpreted in base ten, regardless of the value of 2*read-base**. Only certain letters are allowed for delimiting the exponent: 2e*, 2s*, 2f*, 2d* and 2l*. The case of the letter is not significant. 2s* specifies that the number should be a short float; 2f*, that it should be a full-size float. 2d* or 2l* are equivalent to 2f*; Common Lisp defines them to mean `double float' or `long float', but the Lisp Machine does not support anything longer than a full-size float, so it regards 2d* and 2l* as synonymous with 2f*. 2e* tells the reader to use the current default format, whatever it may be, as specified by the value of 2*read-default-float-format**. 3*read-default-float-format** 1Variable* The value is the type for read to produce by default for floats whose precise type is not specified by the syntax. The value should be either 2global:small-float* or 2global:single-float*, these being the only distinct floating formats that the Lisp Machine has. The default is 2single-float*, to make full-size floats. Here are some examples of printed-representations that always read as full-size floats: 36.03f23 1F-9 1.f3 3d6* Here are some examples of printed-representations that always read as short floats: 30s0 1.5s9 -42S3 1.s5* These read as floats or as a short floats according to 2*read-default-float-format**: 30.0 1.5 14.0 0.01* 3.707 -.3 +3.14159 6.03e23* 31E-9 1.e3* Rationals: The syntax for a rational is an integer, a ratio delimiter, and another integer. The integers may not include the 2^* and 2_* scaling characters or decimal points, and only the first one may have a sign. The ratio delimiter is backslash (2\*) in traditional syntax, slash (2/*) in Common Lisp syntax. Here are examples: 31\2 -100000000000000\3 80\10 2traditional** 31/2 -100000000000000/3 80/10 2Common Lisp** Recall that rationals include the integers; 280\10* as input to the reader is equivalent to 28*. Complex Numbers: The traditional syntax for a complex number is a number (for the real part), a sign (+ or 3-*), an unsigned number (for the imaginary part), and the letter 2i*. The real and imaginary parts can be any type of number, but they are converted to be of the same type (both floating of the same format, or both rational). For example: 31-3\4i* 31.2s0+3.45s8i* The Common Lisp syntax for a complex number is 3#c(1real* 1imag*)*, where 1real* is the real part and 1imag* is the imaginary part. This construction is allowed in traditional syntax too. 3#c(1 -3/4)* 3#c(1.2s0 3.45s8)* Symbols: A string of letters, numbers, and characters without special syntactic meaning is recognized by the reader as a symbol, provided it cannot be interpreted as a number. Alphabetic case is ignored in symbols; lower-case letters are translated to upper-case unless escaped. When the reader sees the p.r. of a symbol, it 1interns* it on a 1package* (see 4(PACKAGES-0)Packages*, for an explanation of interning and the package system). Symbols may start with digits; you could even have one named 2-345t*; 2read* accepts this as a symbol without complaint. If you want to put strange characters (such as lower-case letters, parentheses, or reader macro characters) inside the name of a symbol, they must be escaped. If the symbol's name would look like a number, at least one character in the name must be escaped, but it matters not which one. Examples of symbols: 3foo* 3bar/(baz/) 2; traditional** 3bar\(baz\) 2; Common Lisp** 334w23* 3|Frob Sale| 2and* F|rob |S|ale| 2are equivalent** 3|a/|b| 2; traditional** 3|a\|b| 2; Common Lisp** In Common Lisp syntax, a symbol composed only of two or more periods is not allowed unless escaping is used. The reader can be directed to perform substitutions on the symbols it reads. Symbol substitutions are used to implement the incompatible Common Lisp definitions of various system functions. Reading of Common Lisp code is done with substitutions that replace 2subst* with 2cli:subst*, 2member* with 2cli:member*, and so on. This is why, when a Common Lisp program uses the function 2member*, it gets the standard Common Lisp 2member* function rather than the traditional one. This is why we say that 2cli:member* is ``the Common Lisp version of 2member*''. While 2cli:member* can be referred to from any program in just that way, it exists primarily to be referred to from a Common Lisp program which says simply 2member*. Symbol substitutions do not apply to symbols written with package prefixes, so one can use a package prefix to force a reference to a symbol that is normally substituted for, such as using 2global:member* in a Common Lisp program. Strings: Strings are written with double-quote characters (2"*) before and after the string contents. To include a double-quote character or single-character escape character in the contents, write an extra single-character escape character in front of it. Examples of strings: 3"This is a typical string."* 3"That is a /"cons cell/"." 2;; traditional** 3"That is a \"cons cell\"." 2;; Common Lisp** 3"Strings are often used for I//O." 2;; traditional** 3"Strings are often used for I/O." 2;; Common Lisp** 3"Here comes one backslash: \\" 2;; Common Lisp** Conses: When 2read* sees an open-parenthesis, it knows that the p.r. of a cons is coming, and calls itself recursively to get the elements of the cons or the list that follows. The following are valid p.r.'s of conses: 3(foo . bar)* 3(foo "bar" 33)* 3(foo . ("bar" . (33 . nil)))* 3(foo bar . quux)* The first is a cons, whose car and cdr are both symbols. The second is a list, and the third is equivalent to the second (although 2print* would never produce it). The fourth is a dotted list; the cdr of the last cons cell (the second one) is not 2nil*, but 2quux*. The reader always allocates new cons cells to represent parentheses. They are never shared with other structure, not even part of the same read. For example, 3(let ((x (read)))* 3 (eq (car x) (cdr x)))* 3((a b) . (a b)) 2;; data for read** 3 => nil* because each time 2(a b)* is read, a new list is constructed. This contrasts with the case for symbols, as very often 2read* returns symbols that it found interned in the package rather than creating new symbols itself. Symbols are the only thing that work this way. The dot that separates the two elements of a dotted-pair p.r. for a cons is only recognized if it is surrounded by delimiters (typically spaces). Thus dot may be freely used within print-names of symbols and within numbers. This is not compatible with Maclisp; in Maclisp 2(a.b)* reads as a cons of symbols 2a* and 2b*, whereas in Zetalisp it reads as a list of a symbol 2a.b*. Comments: A comment begins with a semicolon (2;*) and continues to the end of the line. Comments are ignored completely by the reader. If the semicolon is escaped or inside a string, it is not recognized as starting a comment; it is part of a symbol or part of the string. 3;; This is a comment.* 3"This is a string; but no comment."* Another way to write a comment is to start it with 3#|* and end it with 3|#*. This is useful for commenting out multiple-line segments of code. The two delimiters nest, so that 3#| #| |# |#* is a single comment. This prevents surprising results if you use this construct to comment out code which already contains such a comment. 3(cond ((atom x) y)* 3 #|* 3 ((foo x)* 3 (do-it y))* 3 |#* 3 (t (hack y)))* Abbreviations: The single-quote character (2'*) is an abbreviation for a list starting with the symbol 2quote*. The following pairs of p.r.'s produce equal lists: 3'a 2and* (quote a)* 3'(x (y)) 2and* (quote (x (y)))* The backquote character (2`*) and comma are used in a syntax that abbreviates calls to the list and vector construction functions. For example, 3`(a ,b c)* reads as a list whose meaning as a Lisp form is equivalent to 3(list 'a b 'c)* See 4(MACROS-1)Backquote* for full details about backquote. =Node: 4Sharp-sign Constructs* =Text: 3SHARP-SIGN CONSTRUCTS* Sharp-sign (2#*) is used to introduce syntax extensions. It is the beginning of a two-character sequence whose meaning depends on the second character. Sharp-sign is only recognized with a special meaning if it occurs at the beginning of a token. If encountered while a token is in progress, it is a symbol constituent. For example, 3#xff* is a sharp-sign construct that interprets 3ff* as a hexidecimal number, but 31#xff* is just a symbol. If the sharp-sign is followed by decimal digits, the digits form a parameter. The first non-digit determines which sharp-sign construct is actually in use, and the decimal integer parsed from the digits is passed to it. For example, 3#r* means ``read in specified radix''; it must actually be used with a radix notated in decimal between the 3#* and the 3r*, as in 3#8r*. It is possible for a sharp-sign construct to have different meanings in Common Lisp and traditional syntax. The only constructs which differ are 3#\* and 3#/*. The function 2set-dispatch-macro-character* (see 4(READPRINT-4)Read-Macro Characters*) can be used to define additional sharp sign abbreviations. Here are the currently-defined sharp sign constructs: 2#/* 3#/* is used in traditional syntax only to represent the number that is the character code for a character. You can follow the 3#/* with the character itself, or with the character's name. The name is preferable for nonprinting characters, and it is the only way to represent characters which have control bits since they cannot go in files. Here are examples of 3#/*: 3#/a #o141* 3#/A #o101* 3#/( #o50* 3#/c-a 2the character code for Control-A** 3#/c-/a 2the character code for Control-a** 3#/c-sh-a 2the character code for Control-a** 3#/c-/A 2the character code for Control-A** 3#/c-/( 2the character code for Control-(** 3#/return 2the character code for Return** 3#/h-m-system 2the character code for Hyper-Meta-System** To represent a printing character, write 3#/1x** where 1x* is the character. For example, 3#/a* is equivalent to 2#o141* but clearer in its intent. To avoid ambiguity, the character following 1x* should not be a letter; good style would require this anyway. As in strings, upper and lower-case letters are distinguished after 3#/*. Any character works after 3#/*, even those that are normally special to 2read*, such as parentheses. Thus, 3#/A* is equivalent to 2#o101*, and 3#/(* is equivalent to 2#o50*. Note that the slash causes this construct to be parsed correctly by the editors Emacs and Zmacs. Even non-printing characters may be used, but for them it is preferable to use the character's name. To refer to a character by name, write 3#/* followed by the name. For example, 3#/2return** reads as the numeric code for the character 2Return*. The defined character names are documented below (see 4(CHARSTR-1)Character Names*). In general, the names that are written on the keyboard keys are accepted. In addition, all the nonalphanumeric characters have names. The abbreviations 2cr* for 2return* and 2sp* for 2space* are accepted, since these characters are used so frequently. The page separator character is called 2page*, although 2form* and 2clear-screen* are also accepted since the keyboard has one of those legends on the page key. The rules for reading 1name* are the same as those for symbols; thus letters are converted to upper case unless escaped, and the name must be terminated by a delimiter such as a space, a carriage return, or a parenthesis. When the system types out the name of a special character, it uses the same table that 3#/* uses; therefore, any character name typed out is acceptable as input. 3#/* can also be used to read in the names of characters that have modifier bits (Control, Meta, Super and Hyper). The syntax looks like 3#/2control-meta-b** to get a `B' character with the control and meta bits set. You can use any of the prefix bit names 2control*, 2meta*, 2hyper*, and 2super*. They may be in any order, and case is not significant. Prefix bit names can be abbreviated as the single letters 2c*, 2m*, 2h* and 2s*, and 2control* may be spelled 2ctrl* as it is on the keyboard. The last hyphen may be followed by a single character or by any of the special character names normally recognized by 3#/*. A single character is treated the same way the reader normally treats characters in symbols; if you want to use a lower-case character or a special character such as a parenthesis, you must precede it by a slash character. Examples: 3#/2Hyper-Super-A**, 3#/2meta-hyper-roman-i**, 3#/2CTRL-META-/(**. An obsolete method of specifying control bits in a character is to insert the characters 2*, 2*, 2*, 2* and 2* between the 3#* and the 3/*. Those stand for 2control*, 2meta*, 2control-meta*, 2super* and 2hyper*, respectively. This syntax should be converted to the new 3#\2control-meta-x** syntax described below. 2greek* (or 2front*), 2top*, and 2shift* (or 2sh*) are also allowed as prefixes of names. Thus, 3#/2top-g** is equivalent to 3#/ * or 3#/2uparrow**. 3#/2top-g** should be used if you are specifying the keyboard commands of a program and the mnemonic significance belongs to the `2G*' rather than to the actual character code. 2#\* In traditional syntax, 3#\* is a synonym for 3#/*. In the past, 3#/* had to be used before a single character and 3#\* had to be used in all other cases. Now either one is allowed in either case. In Common Lisp syntax, 3#\* produces a character object rather than a fixnum representing a character. 2#/* 3#/1x** is the traditional syntax way to produce a character object. It is used just like 3#/*. Thus, Common Lisp 3#\* is equivalent to traditional syntax 3#/*. 2#^* 3#^1x** is exactly like 3#/2control-1x*** if the input is being read by Zetalisp; it generates Control-1x*. In Maclisp 1x* is converted to upper case and then exclusive-or'ed with 100 (octal). Thus 3#^1x** always generates the character returned by 2tyi* if the user holds down the control key and types 1x*. (In Maclisp 3#/2control-1x*** sets the bit set by the Control key when the TTY is open in 2fixnum* mode.) 2#'* 3#'1foo** is an abbreviation for 2(function 1foo*)*. 1foo* is the p.r. of any object. This abbreviation can be remembered by analogy with the 2'* macro-character, since the 2function* and 2quote* special forms are somewhat analogous. 2#(* 3#(1elements*...)* constructs a vector (rank-one array) of type 2art-q* with elements 1elements*. The length of the vector is the number of elements written. Thus, 3#2(a 5** 2"Foo")* reads as a vector containing a symbol, an integer and a string. If a decimal integer appears after the 3#*, it specifies the length of the vector. The last element written is replicated to fill the remaining elements. 2#a* 3#1n*a 1contents** signifies an array of rank 1n*, containing 1contents*. 1contents* is passed to 2make-array* as the 1initial-contents* argument. It is a list of lists of lists... or vector of vectors... as deep as 1n*. The dimensions of the array are specified by the lengths of the lists or vectors. The rank is specified explicitly so that the reader can distinguish whether a list or vector in the contents is a sequence of array elements or a single array element. The array type is always 2art-q*. Examples: 3#2a ((x y) (a b) ((uu 3) "VV"))* produces a 3 by 2 array. 3(uu 3)* is one of the elements. 3#2a ("foo" "bar")* produces a 2 by 3 array whose elements are character objects. Recall that a string is a kind of vector. 3#0a 5* produces a rank-0 array whose sole element is 5. 2#** 3#*1bbb*...* signifies a bit vector; 1bbb*... are the bits (characters 21* or 20*). A vector of type 2art-1b* is created and filled with the specified bits, the first bit specified going in array element 0. The length is however many bits you specify. Alternatively, specify the length with a decimal number between the 3#* and the 3**. The last 21* or 20* specified is duplicated to fill the additional bits. Thus, 3#82*0101** is the same as 3#*201011111**. 2#s* 3#s(1type* 1slot* 1value* 1slot* 1value* 1slot* 1value* ...)* constructs a structure of type 1type*. Any structure type defined with 2defstruct* can be used as 1type* provided it has a standard constructor taking slot values as keyword arguments. (Standard constructors can be functions or macros; either kind works for 3#s*.) The slot names and values appearing in the read syntax are passed to the constructor so that they initialize the structure. Example: 3(defstruct (foo :named)* 3 bar* 3 lose)* 3#s (foo :bar 5 :lose haha)* produces a 2foo* whose 2bar* component is 5 and whose 2lose* component is 2haha*. 2#=* 2##*'setq circular-structure-reading page Are used to represent circular structure or shared structure. 3#1n*=* preceding an object ``labels'' that object with the label 1n*, a decimal integer. This has no effect on the way the object labeled is read, but it makes the label available for use in a 3#1n*#* construct within that object (to create circular structure) or later on (to create shared structure). 3#1n*#* counts as an object in itself, and reads as the object labeled by 1n*. For example, 3#1=2(a . *#1#2)** is a way of notating a circular list such as would be produced by 2(circular-list 'a)*. The list is labeled with label 1, and then its cdr is given as a reference to label 1. 2(3#1=#:*foo 3#1#*)* is an example of shared structure. An uninterned symbol named 2foo* is used as the first element of the list, and labeled. The second element of the list is the very same uninterned symbol, by virtue of a reference to the label. Printing outputs 3#1n*=* and 3#1n*#* to represent circular or shared structure when 2*print-circle* is non-2nil*. 2#,* Evaluate a form at load time. 3#,1foo** evaluates 1foo* (the p.r. of a Lisp form) at read time, except that during file-to-file compilation it is arranged that 1foo* will be evaluated when the QFASL file is loaded. This is a way, for example, to include in your code complex list-structure constants that cannot be written with 2quote*. Note that the reader does not put 2quote* around the result of the evaluation. You must do this yourself if you want it, typically by using the 2'* macro-character. An example of a case where you do not want 2quote* around it is when this object is an element of a constant list. 2#.* 3#.1foo** evaluates 1foo* (the p.r. of a lisp form) at read time, regardless of who is doing the reading. 2#`* 3#`* is a construct for repeating an expression with some subexpressions varying. It is an abbreviation for writing several similar expressions or for the use of 2mapc*. Each subexpression that is to be varied is written as a comma followed by a list of the things to substitute. The expression is expanded at read time into a 2progn* containing the individual versions. 3#`(send stream ',(:clear-input :clear-output))* expands into 3(progn (send stream :clear-input)* 3 (send stream :clear-output))* Multiple repetitions can be done in parallel by using commas in several subexpressions: 3#`(rename-file ,("foo" "bar") ,("ofoo" "obar"))* expands into 3(progn (rename-file "foo" "ofoo")* 3 (rename-file "bar" "obar"))* If you want to do multiple independent repetitions, you must use nested 3#`* constructs. Individual commas inside the inner 3#`* apply to that 3#`*; they vary at maximum speed. To specify a subexpression that varies in the outer 3#`*, use two commas. 3#`#`(print (* ,(5 7) ,,(11. 13.)))* expands into 3(progn (progn (print (* 5 11.)) (print (* 7 11.)))* 3 (progn (print (* 5 13.)) (print (* 7 13.))) 2#o** 3#o 1number** reads 1number* in octal regardless of the setting of 2*read-base**. Actually, any expression can be prefixed by 3#o*; it is read with 2*read-base** bound to 8. 2#b* Like 3#o* but reads in binary. 2#x* Like 3#x* but reads in radix 16 (hexadecimal). The letters 2a* through 2f* are used as the digits beyond 9. 2#r* 3#1radix*r 1number** reads 1number* in radix 1radix* regardless of the setting of 2*read-base**. As with 3#o*, any expression can be prefixed by 3#1radix*r*; it is read with 2*read-base** bound to 1radix*. 1radix* must be a valid decimal integer between 2 and 36. For example, 3#3r102* is another way of writing 211.* and 3#11r32* is another way of writing 235*. Bases larger than ten use the letters starting with 2a* as the additional digits. 2#c* 3#c(1real* 1imag*)* constructs a complex number with real part 1real* and imaginary 1part*. It is equivalent to 1real2+*imag2i**, except that 3#c* is allowed in Common Lisp syntax and the other is not. 2#+* 'setq sharp-plus page This abbreviation provides a read-time conditionalization facility. It is used as 3#+1feature* 1form**. If 1feature* is a symbol, then this is read as 1form* if 1feature* is present in the list 2*features** (see 4(MISCELL-3)Version Information*). Otherwise, the construct is regarded as whitespace. Alternately, 1feature* may be a boolean expression composed of 2and*, 2or*, and 2not* operators and symbols representing items that may appear on 2*features**. Thus, 3#+2(or** 2lispm amber)* causes the following object to be seen if either of the features 2lispm* or 2amber* is present. For example, 3#+2lispm 1form*** makes 1form* count if being read by Zetalisp, and is thus equivalent to 3#q 1form**. Similarly, 3#+2maclisp 1form*** is equivalent to 3#m 1form**. 3#+2(or** 2lispm nil) 1form** makes 1form* count on either Zetalisp or in NIL. Here is a list of features with standard meanings: 2lispm* This feature is present on any Lisp machine (no matter what version of hardware or software). 2maclisp* This feature is present in Maclisp. 2nil* This feature is present in NIL (New Implementation of Lisp). 2mit* This feature is present in the MIT Lisp machine system, which is what this manual is about. 2symbolics* This feature is present in the Symbolics version of the Lisp machine system. May you be spared the dishonor of using it. 3#+*, and the other read-time conditionalization constructs that follow, discard the following expression by reading it with 2*read-suppress** bound to 2t* if the specified condition is false. 2#-* 3#-1feature* 1form** is equivalent to 3#+2(not 1feature*) 1form***. 2#q* 3#q 1foo** reads as 1foo* if the input is being read by Zetalisp, otherwise it reads as nothing (whitespace). This is considered obsolete; use 3#+2lispm** instead. 2#m* 3#m 1foo** reads as 1foo* if the input is being read into Maclisp, otherwise it reads as nothing (whitespace). This is considered obsolete; use 3#+2maclisp** instead. 2#n* 3#n 1foo** reads as 1foo* if the input is being read into NIL or compiled to run in NIL, otherwise it reads as nothing (white space). This is considered obsolete; use 3#+2nil** instead. 2#* 3#2** introduces an expression in infix notation. 2* should be used to terminate it. The text in between describes a Lisp object such as a symbol, number or list but using a nonstandard, infix-oriented syntax. For example, 3#x:y+car(a1[i,j])* is equivalent to 3(setq x (+ y (car (aref a1 i j))))* It is not strictly true that the Lisp object produced in this way has to be an expression. Since the conversion is done at read time, you can use a list expressed this way for any purpose. But the infix syntax is designed to be used for expressions. For full details, refer to the file 2SYS: IO1; INFIX LISP*. 2#<* This is not legal reader syntax. It is used in the p.r. of objects that cannot be read back in. Attempting to read a 3#2<** signals an error. 2#* This is used in the p.r. of miscellaneous objects (usually named structures or instances) that can be read back in. 3#* should be followed by a typename and any other data needed to construct an object, terminated with a . For example, a pathname might print as 3#FS:ITS-PATHNAME "AI: RMS; TEST 5"* The typename is a keyword that 2read* uses to figure out how to read in the rest of the printed representation and construct the object. It is read in in package 2user* (but it can contain a package prefix). The resulting symbol should either have a 2si:read-instance* property or be the name of a flavor that handles the 2:read-instance* operation. In the first case, the property is applied as a function to the typename symbol itself and the input stream. In the second, the handler for that operation is applied to the operation name (as always), the typename symbol, and the input stream (three arguments, but the first is implicit and not mentioned in the 2defmethod*). 2self* will be 2nil* and instance variables should not be referred to. 2si:print-readably-mixin* is a useful implementation the 2:read-instance* operation for general purposes; see 4(FLAVOR-5)Printing Flavor Instances Readably*. In either case, the handler function should read the remaining data from the stream, and construct and return the datum it describes. It should return with the character waiting to be read from the input stream (2:untyi* it if necessary). 2read* signals an error after it is returned to if a character is not next. The typename can be any symbol with an appropriate property or flavor, not necessarily related to the type of object that is created; but for clarity, it is good if it is the same as the 2type-of* of the object printed. Since the type symbol is passed to the handler, one flavor's handler can be inherited by many other flavors and can examine the type symbol read in to decide what flavor to construct. 2#|* 3#|* is used to comment out entire pieces of code. Such a comment begins with 3#|* and ends with 3|#*. The text in between should be one or more properly balanced p.r.'s of Lisp objects, possibly including nested 3#|...|#* comments. This text is skipped over by the reader, and does not contribute to the value returned by 2read*.