Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Primitive Types

TypeSyntaxExampleNotes
Atom'atom or unquoted'hello, ok, foo-barInterned symbols
IntegerDecimal, hex, binary42, #x2A, #b101010Arbitrary precision
FloatDecimal point or exponent3.14, 1.5e10IEEE 754 double
StringDouble quotes"hello"Actually a list of integers
Binary#"..."#"bytes"Raw byte string
Boolean'true, 'false'trueJust atoms

Atom Syntax:

;; Simple atoms (no quotes needed)
ok
error
foo
foo-bar
foo_bar

;; Quoted atoms (for special characters)
'hello world'
'|complex!@#$|'

;; Booleans are atoms
'true
'false

Number Syntax:

;; Integers
42
-17
0

;; Different bases
#b1010        ; Binary: 10
#o755         ; Octal: 493
#x1A2F        ; Hex: 6703
#16rFF        ; Base 16: 255
#2r1010       ; Base 2: 10

;; Floats
3.14
-0.5
1.5e10
6.022e23

String vs Binary:

;; String (list of integers)
"hello"
; → (104 101 108 108 111)

;; Binary (raw bytes)
#"hello"
; → <<"hello">>

;; Binary syntax
(binary ((str "hello")))
; → <<"hello">>