▼ |  | Unstable: May Change Without Warning

1 | Guidelines for Developing unstable Libraries
2 | Automata: Compiling State Machines
3 | Bytes
4 | Contracts
5 | Contracts for Macro Subexpressions
6 | Debugging
7 | Definitions
8 | Errors
9 | Filesystem
10 | Find
11 | Flonums
12 | Futures
13 | Functions
14 | Hash Tables
15 | Interface-Oriented Programming for Classes
16 | Lazy Require
17 | Lists
18 | Logging
19 | Macro Testing
20 | Mark Parameters
21 | Match
22 | Open place expressions
23 | Options
24 | Parameter Groups
25 | Pretty-Printing
26 | Re-Contracting Identifiers
27 | Sandbox
28 | Sequences
29 | Strings
30 | Structs
31 | Struct Printing
32 | Syntax
33 | Temporal Contracts: Explicit Contract Monitors
34 | Unix Domain Sockets
35 | 2D Syntax
36 | GUI Libraries

On this page:

at-end
in-phase1
in-phase1/ pass2

5.3.6
top ← prev up next →

### 7`` Definitions

Carl Eastlund <cce@racket-lang.org>

This library is unstable; compatibility will not be maintained. See Unstable: May Change Without Warning for more information.

(require unstable/define)

Provides macros for creating and manipulating definitions.

> > syntax

> > (at-end expr)

When used at the top level of a module, evaluates expr at the end of the module. This can be useful for calling functions before their definitions.

Examples:

> > (module Failure scheme
> (f 5)
> (define (f x) x))

> > (require 'Failure)
> f: undefined;
> cannot reference an identifier before its definition
> in module: 'Failure

> > (module Success scheme
> (require unstable/define)
> (at-end (f 5))
> (define (f x) x))

> > (require 'Success)

> > syntax

> > (in-phase1 e)

Executes e during phase 1 (the syntax transformation phase) relative to its context, during pass 1 if it occurs in a head expansion position.

> > syntax

> > (in-phase1/pass2 e)

Executes e during phase 1 (the syntax transformation phase) relative to its context, during pass 2 (after head expansion).
top ← prev up next →