1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-11 23:53:12 +00:00
PDP-10.its/doc/_info_/lisp.sharpm
2016-11-30 17:58:42 +01:00

83 lines
4.0 KiB
Plaintext
Executable File

The extended syntax of #, as indicated by the subsequent character, with
questionable or not-yet-fully worked-out cases indicated by "???", and *
in column 1 meaning NIL/NIL-compatibility only
* " BITS expressed as 4 bits per hexadecimal digit
% MACROEXPAND following form at read time.
' Like single-quote macro. #'foo ==> (FUNCTION foo)
* ( S-expression VECTOR, elements inside list
* Unsigned-integer, or Machine-word
+ Conditional read, for next expression. A feature name, or
list with "OR" or "AND" as first element and remaining elements
as feature names, must immediately follow. Next form is
skipped unless this system has one of the requested features
(for "OR") or unless it has all the requested features (for
"AND".
, Load-time evaluation
- Conditional read, like "#+", but next form is skipped if the
conditions indicated are satisfied.
. Read-time evaluation
0 ... 9 decimal representation for a radix denotation
??? : Flush a package prefix, e.g. #:SI:FOO is the same as FOO
* B Binary notation for a bitstring follows
M Next form is flushed unless this is a MACLISP system
N Next form is flushed unless this is a NIL system
O Octal notation follows, either for a number or for a bitstring
Q Next form is flushed unless this is a LISPM system
R Radix change -- #16R<nnn> reads <nnn> in base 16.
* T Truthity, a specific non-null, not false, constant
X Hexadecimal notation for a number or for a bitstring
^ A FIXNUM, obtained by "controlifying" the next character.
(e.g. #^B is 2, the ascii value of control-B)
/ A FIXNUM, denoted by the next character (e.g. #/A is 65.).
\ A FIXNUM, denoted by the following standard symbolic names:
Name Value Name Value
NULL 0 RETURN 13
ALPHA 2 NEWLINE 13
BETA 3 CR 13
EPSILON 6 NL 13
BELL 7 ALTMODE 27
BACKSPACE 8 ALT 27
BS 8 BACK-NEXT 31
TAB 9 SPACE 32
LINEFEED 10 SP 32
LF 10 DELETE 127
VT 11 RUBOUT 127
FORM 12 HELP 2120
FORMFEED 12
FF 12
The user may add to this list using the function SETSYNTAX-SHARP-MACRO,
whose argument list is
(<character> <type> <function> &OPTIONAL (rt READTABLE))
The general # macro character function will dispatch to <function>
when <character> is the character immediately following the #; the
dispatch table is kept on a per Readtable basis. Or he may use the
autoloadable macro DEFSHARP which provides an easy way to set up "macro
character functions". For example
(defsharp /% (() )
(macroexpand (/#sub-read () READ-STREAM)))
defines (and activates using SETSYNTAX-SHARP-MACRO) a function to be run
when #% occurs. An alternative form is
(defsharp /: SPLICING (() )
(/#-flush-chars-not-set #/: 'T) () )
where the word SPLICING indicates that the result is to be like a
SPLICING readmacro character -- the default is like an elemental
readmacro character.
The # macro works by keying off a second character, with possibly an
argument in between. Currently, the permissible arguments are
(1) digits, for a numeric argument, e.g. #3R201 reads 201 in base 3.
(2) ^B, ^C, or ^F to signify respectively "add control bit", "add meta
bit", and "add control-meta bits". The "control" bit has value
128. and the "meta" bit has value 256.
The alist from /#-MACRO-DATALIST holds, for each valid "second" character,
a 4-list: (<char-code> <peekp> <type> <function>)
where <function> Takes one argument, as described above in (1) and (2). If
there is no "argument" then () is passed to the function.
<type> Is either MACRO or SPLICING
<peekp> A flag which, if non-null, means don't flush the "second"
character from the input stream before running <function>.
<char-code> Is the numeric encoding of the character