(cons #+spice "Spice" #-spice "Lispm" x)
in implementation A ... (CONS "Spice" X)
in implementation B ... (CONS "Lispm" X)
in implementation C ... (CONS "Lispm" X)
All the CLHS figures in one place!
| For Evaluation? | Notation | Typically Implied Role |
|---|---|---|
| Yes | nil | use as a boolean |
| Yes | 'nil | use as a symbol |
| Yes | '() | use as an empty list |
| No | nil | use as a symbol or boolean |
| No | () | use as an empty list |
| Graphic ID | Glyph | Description |
|---|---|---|
| LA01 | a | small a |
| LA02 | A | capital A |
| LB01 | b | small b |
| LB02 | B | capital B |
| LC01 | c | small c |
| LC02 | C | capital C |
| LD01 | d | small d |
| LD02 | D | capital D |
| LE01 | e | small e |
| LE02 | E | capital E |
| LF01 | f | small f |
| LF02 | F | capital F |
| LG01 | g | small g |
| LG02 | G | capital G |
| LH01 | h | small h |
| LH02 | H | capital H |
| LI01 | i | small i |
| LI02 | I | capital I |
| LJ01 | j | small j |
| LJ02 | J | capital J |
| LK01 | k | small k |
| LK02 | K | capital K |
| LL01 | l | small l |
| LL02 | L | capital L |
| LM01 | m | small m |
| LM02 | M | capital M |
| LN01 | n | small n |
| LN02 | N | capital N |
| LO01 | o | small o |
| LO02 | O | capital O |
| LP01 | p | small p |
| LP02 | P | capital P |
| LQ01 | q | small q |
| LQ02 | Q | capital Q |
| LR01 | r | small r |
| LR02 | R | capital R |
| LS01 | s | small s |
| LS02 | S | capital S |
| LT01 | t | small t |
| LT02 | T | capital T |
| LU01 | u | small u |
| LU02 | U | capital U |
| LV01 | v | small v |
| LV02 | V | capital V |
| LW01 | w | small w |
| LW02 | W | capital W |
| LX01 | x | small x |
| LX02 | X | capital X |
| LY01 | y | small y |
| LY02 | Y | capital Y |
| LZ01 | z | small z |
| LZ02 | Z | capital Z |
| Graphic ID | Glyph | Description |
|---|---|---|
| ND01 | 1 | digit 1 |
| ND02 | 2 | digit 2 |
| ND03 | 3 | digit 3 |
| ND04 | 4 | digit 4 |
| ND05 | 5 | digit 5 |
| ND06 | 6 | digit 6 |
| ND07 | 7 | digit 7 |
| ND08 | 8 | digit 8 |
| ND09 | 9 | digit 9 |
| ND10 | 0 | digit 0 |
| Graphic ID | Glyph | Description |
|---|---|---|
| SP02 | ! | exclamation mark |
| SC03 | $ | dollar sign |
| SP04 | " | quotation mark, or double quote |
| SP05 | ' | apostrophe, or [single] quote |
| SP06 | ( | left parenthesis, or open parenthesis |
| SP07 | ) | right parenthesis, or close parenthesis |
| SP08 | , | comma |
| SP09 | _ | low line, or underscore |
| SP10 | - | hyphen, or minus [sign] |
| SP11 | . | full stop, period, or dot |
| SP12 | / | solidus, or slash |
| SP13 | : | colon |
| SP14 | ; | semicolon |
| SP15 | ? | question mark |
| SA01 | + | plus [sign] |
| SA03 | < | less-than [sign] |
| SA04 | = | equals [sign] |
| SA05 | > | greater-than [sign] |
| SM01 | # | number sign, or sharp[sign] |
| SM02 | % | percent [sign] |
| SM03 | & | ampersand |
| SM04 | * | asterisk, or star |
| SM05 | @ | commercial at, or at-sign |
| SM06 | [ | left [square] bracket |
| SM07 | \ | reverse solidus, or backslash |
| SM08 | ] | right [square] bracket |
| SM11 | { | left curly bracket, or left brace |
| SM13 | | | vertical bar |
| SM14 | } | right curly bracket, or right brace |
| SD13 | ` | grave accent, or backquote |
| SD15 | ^ | circumflex accent |
| SD19 | ~ | tilde |
(Slight alterations to the format of the following table have been made to enhance usability.)
(TODO: Linkify syntax types)
| character | syntax type | additional information |
|---|---|---|
| Backspace | constituent | |
| Tab | whitespace | |
| Newline | whitespace | |
| Linefeed | whitespace | |
| Page | whitespace | |
| Return | whitespace | |
| Space | whitespace | |
| ! | constituent | Reserved to programmers |
| " | terminating macro char | |
| # | non-terminating char | |
| $ | constituent | Unused in standard names |
| % | constituent | |
| & | constituent | |
| ' | terminating macro char | |
| ( | terminating macro char | |
| ) | terminating macro char | |
| * | constituent | |
| + | constituent | |
| , | terminating macro char | |
| - | constituent | |
| . | constituent | |
| / | constituent | |
| 0 to 9 | constituent | |
| : | constituent | |
| ; | terminating macro char | |
| < | constituent | |
| = | constituent | |
| > | constituent | |
| ? | constituent | Reserved to programmers |
| @ | constituent | |
| A to Z | constituent | |
| [ | constituent | Reserved to programmers |
| \ | single escape | |
| ] | constituent | Reserved to programmers |
| ^ | constituent | |
| _ | constituent | |
| ` | terminating macro char | |
| a to z | constituent | |
| { | constituent | Reserved to programmers |
| | | multiple escape | |
| } | constituent | Reserved to programmers |
| ~ | constituent | Reserved to implementors |
| Rubout | constituent |
(Slight alterations to the format of the following table have been made to enhance usability.)
(TODO: Linkify constituent traits)
| character | constituent traits | Normally shadowed? |
|---|---|---|
| Backspace | invalid | |
| Tab | invalid | ✔ |
| Newline | invalid | ✔ |
| Linefeed | invalid | ✔ |
| Page | invalid | ✔ |
| Return | invalid | ✔ |
| Space | invalid | ✔ |
| ! | alphabetic | |
| " | alphabetic | |
| # | alphabetic | ✔ |
| $ | alphabetic | |
| % | alphabetic | |
| & | alphabetic | |
| ' | alphabetic | ✔ |
| ( | alphabetic | ✔ |
| ) | alphabetic | ✔ |
| * | alphabetic | |
| , | alphabetic | ✔ |
| 0 to 9 | alphadigit | |
| : | package marker | |
| ; | alphabetic | ✔ |
| < | alphabetic | |
| = | alphabetic | |
| > | alphabetic | |
| ? | alphabetic | |
| @ | alphabetic | |
| [ | alphabetic | |
| \ | alphabetic | ✔ |
| ] | alphabetic | |
| ^ | alphabetic | |
| _ | alphabetic | |
| ` | alphabetic | ✔ |
| | | alphabetic | ✔ |
| ~ | alphabetic | |
| { | alphabetic | |
| } | alphabetic | |
| + | alphabetic, plus sign | |
| - | alphabetic, minus sign | |
| . | alphabetic, dot, decimal point | |
| / | alphabetic, ratio marker | |
| A a | alphadigit | |
| B b | alphadigit | |
| C c | alphadigit | |
| D d | alphadigit, double-float exponent marker | |
| E e | alphadigit, float exponent-marker | |
| F f | alphadigit, single-float exponent marker | |
| G g | alphadigit | |
| H h | alphadigit | |
| I i | alphadigit | |
| J j | alphadigit | |
| K k | alphadigit | |
| L l | alphadigit, long-float exponent marker | |
| M m | alphadigit | |
| N n | alphadigit | |
| O o | alphadigit | |
| P p | alphadigit | |
| Q q | alphadigit | |
| R r | alphadigit | |
| S s | alphadigit, short-float exponent marker | |
| T t | alphadigit | |
| U u | alphadigit | |
| V v | alphadigit | |
| W w | alphadigit | |
| X x | alphadigit | |
| Y y | alphadigit | |
| Z z | alphadigit | |
| Rubout | invalid |
numeric-token ::= integer |
ratio |
float
integer ::= [sign]
decimal-digit+
decimal-point |
[sign]
digit+
ratio ::= [sign]
{digit}+
slash
{digit}+
float ::= [sign]
{decimal-digit}*
decimal-point
{decimal-digit}+
[exponent]
|
[sign]
{decimal-digit}+
[decimal-point
{decimal-digit}*]
exponent
exponent ::= exponent-marker
[sign]
{digit}+
sign --- a sign.
slash --- a slash
decimal-point --- a dot.
exponent-marker --- an exponent marker.
decimal-digit --- a digit in radix 10.
digit --- a digit in the current input radix.
| 2/3 | This is in canonical form |
| 4/6 | A non-canonical form for 2/3 |
| -17/23 | A ratio preceded by a sign |
| -30517578125/32768 | This is (-5/2)^15 |
| 10/5 | The canonical form for this is 2 |
| #o-101/75 | Octal notation for -65/61 |
| #3r120/21 | Ternary notation for 15/7 |
| #Xbc/ad | Hexadecimal notation for 188/173 |
| #xFADED/FACADE | Hexadecimal notation for 1027565/16435934 |
| 0.0 | Floating-point zero in default format |
| 0E0 | As input, this is also floating-point zero in default format. As output, this would appear as 0.0. |
| 0e0 | As input, this is also floating-point zero in default format. As output, this would appear as 0.0. |
| -.0 | As input, this might be a zero or a minus zero, depending on whether the implementation supports a distinct minus zero. As output, 0.0 is zero and -0.0 is minus zero. |
| 0. | On input, the integer zero---not a floating-point number! Whether this appears as 0 or 0. on output depends on the value of *print-radix*. |
| 0.0s0 | A floating-point zero in short format |
| 0s0 | As input, this is a floating-point zero in short format. As output, such a zero would appear as 0.0s0 (or as 0.0 if short-float was the default format). |
| 6.02E+23 | Avogadro's number, in default format |
| 602E+21 | Also Avogadro's number, in default format |
| FROBBOZ | The symbol whose name is FROBBOZ. |
| frobboz | Another way to notate the same symbol. |
| fRObBoz | Yet another way to notate it. |
| unwind-protect | A symbol with a hyphen in its name. |
| +$ | The symbol named +$. |
| 1+ | The symbol named 1+. |
| +1 | This is the integer 1, not a symbol. |
| pascal_style | This symbol has an underscore in its name. |
| file.rel.43 | This symbol has periods in its name. |
| \( | The symbol whose name is (. |
| \+1 | The symbol whose name is +1. |
| +\1 | Also the symbol whose name is +1. |
| \frobboz | The symbol whose name is fROBBOZ. |
| 3.14159265\s0 | The symbol whose name is 3.14159265s0. |
| 3.14159265\S0 | A different symbol, whose name is 3.14159265S0. |
| 3.14159265s0 | A possible short float approximation to <PI>. |
| APL\\360 | The symbol whose name is APL\360. |
| apl\\360 | Also the symbol whose name is APL\360. |
| \(b^2\)\-\4*a*c | The name is (B^2) - 4*A*C. Parentheses and two spaces in it. |
| \(\b^2\)\-\4*\a*\c | The name is (b^2) - 4*a*c. Letters explicitly lowercase. |
| |"| | The same as writing \". |
| |(b^2) - 4*a*c| | The name is (b^2) - 4*a*c. |
| |frobboz| | The name is frobboz, not FROBBOZ. |
| |APL\360| | The name is APL360. |
| |APL\\360| | The name is APL\360. |
| |apl\\360| | The name is apl\360. |
| |\|\|| | Same as \|\| ---the name is ||. |
| |(B^2) - 4*A*C| | The name is (B^2) - 4*A*C. Parentheses and two spaces in it. |
| |(b^2) - 4*a*c| | The name is (b^2) - 4*a*c. |
| nnnnn | a number |
| xxxxx | a symbol in the current package |
| :xxxxx | a symbol in the the KEYWORD package |
| ppppp:xxxxx | an external symbol in the ppppp package |
| ppppp::xxxxx | a (possibly internal) symbol in the ppppp package |
| :nnnnn | undefined |
| ppppp:nnnnn | undefined |
| ppppp::nnnnn | undefined |
| ::aaaaa | undefined |
| aaaaa: | undefined |
| aaaaa:aaaaa:aaaaa | undefined |
| "Foo" | A string with three characters in it |
| "" | An empty string |
| "\"APL\\360?\" he cried." | A string with twenty characters |
| "|x| = |-x|" | A ten-character string |
| dispatch char | purpose | Reserved to user? |
|---|---|---|
| Backspace | signals error | |
| Tab | signals error | |
| Newline | signals error | |
| Linefeed | signals error | |
| Page | signals error | |
| Return | signals error | |
| Space | signals error | |
| ! | undefined | ✔ |
| " | undefined | |
| # | reference to = label | |
| $ | undefined | |
| % | undefined | |
| & | undefined | |
| ' | function abbreviation | |
| ( | simple vector | |
| ) | signals error | |
| * | bit vector | |
| , | undefined | |
| : | uninterned symbol | |
| ; | undefined | |
| < | signals error | |
| = | labels following object | |
| > | undefined | |
| ? | undefined | ✔ |
| @ | undefined | |
| [ | undefined | ✔ |
| \ | character object | ✔ |
| ] | undefined | ✔ |
| ^ | undefined | |
| _ | undefined | |
| ` | undefined | |
| | | balanced comment | |
| ~ | undefined | |
| { | undefined | ✔ |
| } | undefined | ✔ |
| + | read-time conditional | |
| - | read-time conditional | |
| . | read-time evaluation | |
| / | undefined | |
| A a | array | |
| B b | binary rational | |
| C c | complex number | |
| D d | undefined | |
| E e | undefined | |
| F f | undefined | |
| G g | undefined | |
| H h | undefined | |
| I i | undefined | |
| J j | undefined | |
| K k | undefined | |
| L l | undefined | |
| M m | undefined | |
| N n | undefined | |
| O o | octal rational | |
| P p | pathname | |
| Q q | undefined | |
| R r | radix-n rational | |
| S s | structure | |
| T t | undefined | |
| U u | undefined | |
| V v | undefined | |
| W w | undefined | |
| X x | hexadecimal rational | |
| Y y | undefined | |
| Z z | undefined | |
| Rubout | undefined |
| #2r11010101 | Another way of writing 213 decimal |
| #b11010101 | Ditto |
| #b+11010101 | Ditto |
| #o325 | Ditto, in octal radix |
| #xD5 | Ditto, in hexadecimal radix |
| #16r+D5 | Ditto |
| #o-300 | Decimal -192, written in base 8 |
| #3r-21010 | Same thing in base 3 |
| #25R-7H | Same thing in base 25 |
| #xACCEDED | 181202413, in hexadecimal radix |
| #C(3.0s1 2.0s-1) | A complex with small float parts. |
| #C(5 -3) | A ``Gaussian integer'' |
| #C(5/3 7.0) | Will be converted internally to #C(1.66666 7.0) |
| #C(0 1) | The imaginary unit; that is, i. |
| :compile-toplevel | :load-toplevel | :execute | Processing mode | Action | New mode |
|---|---|---|---|---|---|
| Yes | Yes | ∅ | Process | compile-time-too | |
| No | Yes | Yes | compile-time-too | Process | compile-time-too |
| No | Yes | Yes | not-compile-time | Process | not-compile-time |
| No | Yes | No | ∅ | Process | not-compile-time |
| Yes | No | ∅ | Evaluate | ∅ | |
| No | No | Yes | compile-time-too | Evaluate | |
| No | No | Yes | not-compile-time | Discard | |
| No | No | No | ∅ | Discard | |
| Context | Kind of Lambda List |
|---|---|
| defun form | ordinary lambda list |
| defmacro form | macro lambda list |
| lambda expression | ordinary lambda list |
| flet local function definition | ordinary lambda list |
| labels local function definition | ordinary lambda list |
| handler-case clause specification | ordinary lambda list |
| restart-case clause specification | ordinary lambda list |
| macrolet local macro definition | macro lambda list |
| define-method-combination | ordinary lambda list |
| define-method-combination :arguments option | define-method-combination arguments lambda list |
| defstruct :constructor option | boa lambda list |
| defgeneric form | generic function lambda list |
| defgeneric method clause | specialized lambda list |
| defmethod form | specialized lambda list |
| defsetf form | defsetf lambda list |
| define-setf-expander form | macro lambda list |
| deftype form | deftype lambda list |
| destructuring-bind form | destructuring lambda list |
| define-compiler-macro form | macro lambda list |
| define-modify-macro form | define-modify-macro lambda list |
| Section | Data Type |
|---|---|
| Section 4.3 (Classes) | Object System types |
| Section 7.5 (Slots) | Object System types |
| Section 7 (Objects) | Object System types |
| Section 7.6 (Generic Functions and Methods) | Object System types |
| Section 9.1 (Condition System Concepts) | Condition System types |
| Section 4 (Types and Classes) | Miscellaneous types |
| Section 2 (Syntax) | All types---read and print syntax |
| Section 22.1 (The Lisp Printer) | All types---print syntax |
| Section 3.2 (Compilation) | All types---compilation issues |
| Access function | Update Function | Update using setf |
|---|---|---|
| x | (setq x datum) | (setf x datum) |
| (car x) | (rplaca x datum) | (setf (car x) datum) |
| (symbol-value x) | (set x datum) | (setf (symbol-value x) datum) |
For a variable x:
| () | list of temporary variables |
| () | list of value forms |
| (g0001) | list of store variables |
| (setq x g0001) | storing form |
| x | accessing form |
For (car exp):
| (g0002) | list of temporary variables |
| (exp) | list of value forms |
| (g0003) | list of store variables |
| (progn (rplaca g0002 g0003) g0003) | storing form |
| (car g0002) | accessing form |
For (subseq seq s e):
| (g0004 g0005 g0006) | list of temporary variables |
| (seq s e) | list of value forms |
| (g0007) | list of store variables |
(progn
(replace g0004 g0007
:start1 g0005 :end1 g0006)
g0007) |
storing form |
| (subseq g0004 g0005 g0006) | accessing form |
[...] For (ldb bs (car exp)):
| (g0001 g0002) | list of temporary variables |
| (bs exp) | list of value forms |
| (g0003) | list of store variables |
(progn
(rplaca g0002
(dpb g0003 g0001 (car g0002)))
g0003) |
storing form |
| (ldb g0001 (car g0002)) | accessing form |
| Function name | Argument that is a place | Update function used |
|---|---|---|
| ldb | second | dpb |
| mask-field | second | deposit-field |
| getf | first | implementation-dependent |
| Name | Nicknames |
|---|---|
| COMMON-LISP | CL |
| COMMON-LISP-USER | CL-USER |
| KEYWORD | none |
| Function | Sample Results | |
|---|---|---|
| abs | (abs #c(3 4)) | 5 or 5.0 |
| acos | (acos 1) | 0 or 0.0 |
| acosh | (acosh 1) | 0 or 0.0 |
| asin | (asin 0) | 0 or 0.0 |
| asinh | (asinh 0) | 0 or 0.0 |
| atan | (atan 0) | 0 or 0.0 |
| atanh | (atanh 0) | 0 or 0.0 |
| cis | (cis 0) | 1 or #c(1.0 0.0) |
| cos | (cos 0) | 1 or 1.0 |
| cosh | (cosh 0) | 1 or 1.0 |
| exp | (exp 0) | 1 or 1.0 |
| expt | (expt 8 1/3) | 2 or 2.0 |
| log | (log 1) | 0 or 0.0 |
| (log 8 2) | 3 or 3.0 | |
| phase | (phase 7) | 0 or 0.0 |
| signum | (signum #c(3 4)) | #c(3/5 4/5) or #c(0.6 0.8) |
| sin | (sin 0) | 0 or 0.0 |
| sinh | (sinh 0) | 0 or 0.0 |
| sqrt | (sqrt 4) | 2 or 2.0 |
| (sqrt 9/16) | 3/4 or 0.75 | |
| tan | (tan 0) | 0 or 0.0 |
| tanh | (tanh 0) | 0 or 0.0 |
| sin i z = i sinh z | sinh i z = i sin z | arctan i z = i arctanh z |
| cos i z = cosh z | cosh i z = cos z | arcsinh i z = i arcsin z |
| tan i z = i tanh z | arcsin i z = i arcsinh z | arctanh i z = i arctan z |
| Symbol | Meaning |
|---|---|
| :wild | Wildcard match of one level of directory structure |
| :wild-inferiors | Wildcard match of any number of directory levels |
| :up | Go upward in directory structure (semantic) |
| :back | Go upward in directory structure (syntactic) |
<-1---<--<--2---3->--4-->->
000000000000000000000000000
11 111111111111111111111111
22 222
333 3333
44444444444444 44444
in implementation A ... (CONS "Spice" X)
in implementation B ... (CONS "Lispm" X)
in implementation C ... (CONS "Lispm" X)
in implementation A ... (CONS "Spice" X)
in implementation B ... (CONS "Lispm" X)
in implementation C ... (CONS X)
in implementation A ... (SETQ A '(1 2 43))
in implementation B ... (SETQ A '(1 2 27))
in implementation C ... (SETQ A '(1 2 27))
in implementation A ... (LET ((A 3) (B 3)) (FOO A))
in implementation B ... (LET ((A 3) (B 3)) (FOO A))
in implementation C ... (LET ((A 3)) (FOO A))
in implementation A ... (CONS "foo" X)
in implementation B ... (CONS "#+Spice" X)
in implementation C ... (CONS 7 X)