10.9 Unreachable Expressions

► |  | The Racket Reference

1 | Language Model
2 | Notation for Documentation
3 | Syntactic Forms
4 | Datatypes
5 | Structures
6 | Classes and Objects
7 | Units
8 | Contracts
9 | Pattern Matching
10 | Control Flow
11 | Concurrency and Parallelism
12 | Macros
13 | Input and Output
14 | Reflection and Security
15 | Operating System
16 | Memory Management
17 | Unsafe Operations
18 | Running Racket
| Bibliography
| Index

▼ | 10 | Control Flow

10.1 | Multiple Values
10.2 | Exceptions
10.3 | Delayed Evaluation
10.4 | Continuations
10.5 | Continuation Marks
10.6 | Breaks
10.7 | Exiting
10.8 | Black-Box Procedure
10.9 | Unreachable Expressions

► | 10.9 | Unreachable Expressions

10.9.1 | Customized Unreachable Reporting

On this page:

assert-unreachable
10.9.1 Customized Unreachable Reporting
with-assert-unreachable

top contents ← prev up next →

### 10.9 Unreachable Expressions🔗ℹ

> procedure (assert-unreachable) → none/c

Reports an assertion failure by raising exn:fail:contract, which is useful as a safe counterpart to unsafe-assert-unreachable.

Added in version 8.0.0.11 of package base.

#### 10.9.1 Customized Unreachable Reporting🔗ℹ

(require racket/unreachable) | package: base

The bindings documented in this section are provided by the racket/unreachable library, not racket/base or racket.

Added in version 8.0.0.11 of package base.

> > syntax
> > (with-assert-unreachable
> > body ...+)

Similar to (assert-unreachable), asserts that the body forms should not be reached.

Unless the expression is part of a module that includes (#%declare #:unsafe), then it is equivalent to (let-values () body ...+). The intent is that the body forms will raise exn:fail:contract.

When a with-assert-unreachable expression is part of a module with (#%declare #:unsafe), then it is equivalent to (unsafe-assert-unreachable).

top contents ← prev up next →