# 15.5 Logging
(non-flag)	→```
Returns a string for the current machine’s hostname (including its domain).
> ```
(getpid)  →  exact-integer?
```
Returns an integer identifying the current process within the operating system.

------------------------------------------------------------------------

# 16 Memory Management

8.18.0.13

## 16 Memory Management

|  |
|----------------------------------------------------------------------------------|
|     16.1 Weak Boxes  |
|     16.2 Ephemerons  |
|     16.3 Wills and Executors  |
|     16.4 Garbage Collection |
|     16.5 Phantom Byte Strings  |

------------------------------------------------------------------------

# 16.1 Weak Boxes

### 16.1 Weak Boxes

A weak box is similar to a normal box (see Boxes), but when the garbage collector (see Garbage Collection) can prove that the content value of a weak box is only reachable via weak references, the content of the weak box is replaced with #f. A weak reference is a reference through a weak box, through a key reference in a weak hash table (see Hash Tables), through a value in an ephemeron where the value can be replaced by #f (see Ephemerons), or through a custodian (see Custodians).

> ```
(make-weak-box v) → weak-box?
  v : any/c```

Returns a new weak box that initially contains v.

> ```
(weak-box-value weak-box [gced-v) → any/c
  weak-box : weak-box?
  gced-v : any/c = #f
```


# 15.5 Logging
Returns the value contained in weak-box. If the garbage collector has proven that the previous content value of weak-box was reachable only through a weak reference, then gced-v (which defaults to #f) is returned.
> ```
(weak-box? v)  →  boolean?
  v : any/c
```

Returns #t if v is a weak box, #f otherwise.

------------------------------------------------------------------------

# 16.2 Ephemerons

### 16.2 Ephemerons

An ephemeron \[[Hayes97](doc-bibliography.html#%28cite._.Hayes97%29)\] is a generalization of a [weak box](weakbox.html#%28tech._weak._box%29) (see [Weak Boxes](weakbox.html)). Instead of just containing one value, an ephemeron holds two values: one that is considered the value of the ephemeron and another that is the ephemeron’s key. Like the value in a weak box, the value in an ephemeron may be replaced by #f, but when the key is no longer reachable (except possibly via weak references) instead of when the value is no longer reachable.

As long as an ephemeron’s value is retained, the reference is considered a non-weak reference. References to the key via the value are treated specially, however, in that the reference does not necessarily count toward the key’s reachability. A [weak box](weakbox.html#%28tech._weak._box%29) can be seen as a specialization of an ephemeron where the key and value are the same.

One particularly common use of ephemerons is to combine them with a weak hash table (see [Hash Tables](hashtables.html)) to produce a mapping where the memory manager can reclaim key–value pairs even when the value refers to the key; see [make-ephemeron-hash](hashtables.html#%28def._%28%28quote._~23~25kernel%29._make-ephemeron-hash%29%29). A related use is to retain a reference to a value as long as any value for which it is an [impersonator](chaperones.html#%28tech._impersonator%29) is reachable; see [impersonator-ephemeron](chaperones.html#%28def._%28%28quote._~23~25kernel%29._impersonator-ephemeron%29%29).

More precisely,

-   the value in an ephemeron is replaced by #f when the automatic memory manager can prove that either the ephemeron or the key is reachable only through weak references (see [Weak Boxes](weakbox.html)); and

-   nothing reachable from the value in an ephemeron counts toward the reachability of an ephemeron key (whether for the same ephemeron or another), unless the same value is reachable through a non-weak reference, or unless the value’s ephemeron key is reachable through a non-weak reference (see [Weak Boxes](weakbox.html) for information on weak references).

> ```
(make-ephemeron key v)  →  ephemeron?
  key : any/c
  v : any/c
```


# 15.5 Logging
Returns a new ephemeron whose key is key and whose value is initially v.
> ```
(ephemeron-value ephemeron [gced-v retain-v) → any/c
  ephemeron : ephemeron?
  gced-v : any/c = #f
  retain-v : any/c = #f```
Returns the value contained in ephemeron. If the garbage collector has proven that the key for ephemeron is only weakly reachable, then the result is gced-v (which defaults to #f).
The retain-v argument is retained as reachable until the ephemeron’s value is extracted. It is useful, for example, when ephemeron was obtained through a weak, [eq?](Equality.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29)-based mapping from key and ephemeron was created with key as the key; in that case, supplying key as retain-v ensures that ephemeron retains its value long enough for it to be extracted, even if key is otherwise unreachable.
Changed in version 7.1.0.10 of package base: Added the retain-v argument.
> ```
(ephemeron? v)  →  boolean?
  v : any/c


# 15.5 Logging
```
Returns #t if v is an ephemeron, #f otherwise.

------------------------------------------------------------------------

# 16.3 Wills and Executors

### 16.3 Wills and Executors

A will executor manages a collection of values and associated will procedures (a.k.a. finalizers). The will procedure for each value is ready to be executed when the value has been proven (by the garbage collector) to be unreachable, except through weak references (see Weak Boxes) or as the registrant for other will executors. A will is useful for triggering clean-up actions on data associated with an unreachable value, such as closing a port embedded in an object when the object is no longer used.

Calling the will-execute or will-try-execute procedure executes a will that is ready in the specified will executor. A will executor is also a synchronizable event, so sync or sync/timeout can be used to detect when a will executor has ready wills. Wills are not executed automatically, because certain programs need control to avoid race conditions. However, a program can create a thread whose sole job is to execute wills for a particular executor.

If a value is registered with multiple wills (in one or multiple executors), the wills are readied in the reverse order of registration. Since readying a will procedure makes the value reachable again, the will must be executed and the value must be proven again unreachable through only weak references before another of the wills is readied or executed. However, wills for distinct unreachable values are readied at the same time, regardless of whether the values are reachable from each other.

A will executor’s registrant is held non-weakly until after the corresponding will procedure is executed. Thus, if the content value of a weak box (see Weak Boxes) is registered with a will executor, the weak box’s content is not changed to #f until all wills have been executed for the value and the value has been proven again reachable through only weak references.

A will executor can be used as a synchronizable event (see Events). A will executor is ready for synchronization when will-execute would not block; the synchronization result of a will executor is the will executor itself.

These examples show how to run cleanup actions when no synchronization is necessary. It simply runs the registered executors as they become ready in another thread.

Examples:

> ```racket
> > ( define an-executor ( make-will-executor ) )
> > ( void ( thread ( λ ( ) ( let loop ( ) ( will-execute an-executor ) ( loop ) ) ) ) )
> > ( define ( executor-proc v ) ( printf "a-box is now garbage\n" ) )
> > ( define a-box-to-track ( box #f ) )
> > ( will-register an-executor a-box-to-track executor-proc )
> > ( collect-garbage )
> > ( set! a-box-to-track #f )
> > ( collect-garbage )
> a-box is now garbage
> ```

> ```
(make-will-executor)   →   will-executor?```

Returns a new will executor with no managed values.

> ```
(will-executor? v)  →  boolean?
  v : any/c
```


# 15.5 Logging
(parameter)	→
(-> any/c . → . any)```
Registers the value v with the will procedure proc in the will executor executor. When v is proven unreachable, then the procedure proc is ready to be called with v as its argument via [will-execute](#%28def._%28%28quote._~23~25kernel%29._will-execute%29%29) or [will-try-execute](#%28def._%28%28quote._~23~25kernel%29._will-try-execute%29%29). The proc argument is strongly referenced until the will procedure is executed.
> ```
(will-execute executor)  →  any
  executor : will-executor?
```
Invokes the will procedure for a single “unreachable” value registered with the executor executor. The values returned by the will procedure are the result of the will-execute call. If no will is ready for immediate execution, will-execute blocks until one is ready.

> ```
(will-try-execute executor [v) → any
  executor : any/c
  v : any/c = #f```

Like [will-execute](#%28def._%28%28quote._~23~25kernel%29._will-execute%29%29) if a will is ready for immediate execution. Otherwise, v is returned.

Changed in version 6.90.0.4 of package base: Added the v argument.

------------------------------------------------------------------------

# 16.4 Garbage Collection

### 16.4 Garbage Collection

Set the PLTDISABLEGC environment variable (to any value) before Racket starts to disable [garbage collection](eval-model.html#%28tech._garbage._collection%29). Set the PLT_INCREMENTAL_GC environment variable to a value that starts with 1, y, or Y to request incremental mode at all times for the [3m](implementations.html#%28tech._3m%29) implementation of Racket, but calling ([collect-garbage](#%28def._%28%28quote._~23~25kernel%29._collect-garbage%29%29) 'incremental) in a program with a periodic task is generally a better mechanism for requesting incremental mode. Set the PLT_INCREMENTAL_GC environment variable to a value that starts with 0, n, or N to disable incremental-mode requests (in all implementations of Racket).

Each garbage collection logs a message (see [Logging](logging.html)) at the 'debug level with topic 'GC. In the [CS](implementations.html#%28tech._c%29) and [3m](implementations.html#%28tech._3m%29) implementations of Racket, “major” collections are also logged at the 'debug level with the topic 'GC:major. In the [CS](implementations.html#%28tech._c%29) and [3m](implementations.html#%28tech._3m%29) implementations of Racket, the data portion of the message is an instance of a gc-info [prefab](structures.html#%28tech._prefab%29) structure type with 10 fields as follows, but future versions of Racket may use a gc-info [prefab](structures.html#%28tech._prefab%29) structure with additional fields:

> ```racket
> ( struct gc-info ( mode pre-amount pre-admin-amount code-amount
> post-amount post-admin-amount
> start-process-time end-process-time
> start-time end-time )
> #:prefab )
> ```

-   The mode field is a symbol 'major, 'minor, or 'incremental; 'major indicates a collection that inspects all memory, 'minor indicates collection that mostly inspects just recent allocations, and 'incremental indicates a minor collection that performs extra work toward the next major collection.

    Changed in version 6.3.0.7 of package base: Changed first field from a boolean (#t for 'major, #f for 'minor) to a mode symbol.

-   The pre-amount field reports place-local memory use (i.e., not counting the memory use of child places) in bytes at the time that the [garbage collection](eval-model.html#%28tech._garbage._collection%29) started. Additional bytes registered via [make-phantom-bytes](phantom-bytes.html#%28def._%28%28quote._~23~25kernel%29._make-phantom-bytes%29%29) are included.

-   The pre-admin-amount is a larger number that includes memory use for the garbage collector’s overhead, such as space on memory pages that are mapped but not currently used.

-   The code-amount field reports additional memory use for generated native code (which is the same just before and after a garbage collection, since it is released via finalization).

-   The post-amount and post-admin-amount fields correspond to pre-amount and pre-admin-amount, but after garbage collection. In typical configurations, the difference between post-amount and pre-amount contributes to post-admin-amount, since reclaimed pages tend to stay in reserve with the expectation that they’ll be needed again (but the pages are released if multiple collections pass without need for the pages).

-   The start-process-time and end-process-time fields report processor time (in the sense of [current-process-milliseconds](time.html#%28def._%28%28quote._~23~25kernel%29._current-process-milliseconds%29%29)) at the start and end of garbage collection. The difference between the times is the processor time consumed by collection.

-   The start-time and end-time fields report real time (in the sense of [current-inexact-milliseconds](time.html#%28def._%28%28quote._~23~25kernel%29._current-inexact-milliseconds%29%29)) at the start and end of garbage collection. The difference between the times is the real time consumed by garbage collection.

The format of the logged message’s text is subject to change. Currently, after a prefix that indicates the [place](places.html#%28tech._place%29) and collection mode, the text has the format

> ‹used›(‹admin›)\[‹code›\]; free ‹reclaimed›(‹adjust›) ‹elapsed› @ ‹timestamp›
>
> |             |     |                                                               |
> |-------------|-----|---------------------------------------------------------------|
> | ‹used›      |     | Collectable memory in use just prior to garbage collection    |
> | ‹admin›     |     | Additional memory used as to manage collectable memory        |
> | ‹code›      |     | Additional memory used for generated machine code             |
> | ‹reclaimed› |     | Collectable memory reclaimed by garbage collection            |
> | ‹adjust›    |     | Negation of change to administrative memory minus ‹reclaimed› |
> | ‹elapsed›   |     | Processor time used to perform garbage collection             |
> | ‹timestamp› |     | Processor time since startup of garbage collection’s start    |

Changed in version 6.3.0.7 of package base: Added PLT_INCREMENTAL_GC.
Changed in version 7.6.0.9: Added major-collection logging for the topic 'GC:major.

> ```
(parameter)	→
(-> or/c 'major 'minor 'incremental)
```


# 15.5 Logging
(parameter)	→
(-> or/c #f 'cumulative 'peak custodian?)```
Returns information about memory use:
-   If mode is #f (the default), the result is an estimate of the number of bytes reachable from any custodian.
-   If mode is 'cumulative, returns an estimate of the total number of bytes allocated since start up, including bytes that have since been reclaimed by garbage collection.
-   If mode is 'peak, returns the maximum number of allocated bytes just before any garbage collection in the Racket process since its start.
-   If mode is a custodian, returns an estimate of the number of bytes of memory occupied by reachable data from mode. This estimate is calculated by the last garbage collection, and can be 0 if none occurred (or if none occurred since the given custodian was created). The [current-memory-use](#%28def._%28%28quote._~23~25kernel%29._current-memory-use%29%29) function does not perform a collection by itself; doing one before the call will generally decrease the result (or increase it from 0 if no collections happened yet).
    When Racket is compiled without support for memory accounting, the estimate is the same as when mode is #f (i.e., all memory) for any individual custodian. See also [custodian-memory-accounting-available?](custodians.html#%28def._%28%28quote._~23~25kernel%29._custodian-memory-accounting-available~3f%29%29).
See also [vector-set-performance-stats!](runtime.html#%28def._%28%28quote._~23~25kernel%29._vector-set-performance-stats%21%29%29).


# 15.5 Logging
Changed in version 6.6.0.3 of package base: Added 'cumulative mode.
Changed in version 8.10.0.3: Added 'peak mode.
> ```
(dump-memory-stats v ...) → any
  v : any/c
```
(parameter)	→```

Returns #t if v is a [phantom byte string](#%28tech._phantom._byte._string%29), #f otherwise.

> ```
(make-phantom-bytes k)  →  phantom-bytes?
  k : exact-nonnegative-integer?
```
Creates a phantom byte string that is treated by the Racket memory manager as being k bytes in size. For a large enough k, the exn:fail:out-of-memory exception is raised—either because the size is implausibly large, or because a memory limit has been installed with custodian-limit-memory.
> ```
(set-phantom-bytes! phantom-bstr k)   →   phantom-bytes?
  phantom-bstr : phantom-bytes?
  k : exact-nonnegative-integer?```
Adjusts the size of a [phantom byte string](#%28tech._phantom._byte._string%29) as it is treated by the Racket memory manager.
For example, if the memory that phantom-bstr represents is released through a foreign library, then ([set-phantom-bytes!](#%28def._%28%28quote._~23~25kernel%29._set-phantom-bytes%21%29%29) phantom-bstr 0) can reflect the change in memory use.
When k is larger than the current size of phantom-bstr, then this function can raise [exn:fail:out-of-memory](exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3aout-of-memory%29%29), like [make-phantom-bytes](#%28def._%28%28quote._~23~25kernel%29._make-phantom-bytes%29%29).
------------------------------------------------------------------------


# 17 Unsafe Operations


## 17 Unsafe Operations
|                                                                                |                                                                                |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------:|
|  ([require](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29) [racket/unsafe/ops]()) |  package: [base](https://pkgs.racket-lang.org/package/base "Install this package using `raco pkg install base`") |
All functions and forms provided by [racket/base](index.html) and [racket](index.html) check their arguments to ensure that the arguments conform to contracts and other constraints. For example, [vector-ref](vectors.html#%28def._%28%28quote._~23~25kernel%29._vector-ref%29%29) checks its arguments to ensure that the first argument is a vector, that the second argument is an exact integer, and that the second argument is between 0 and one less than the vector’s length, inclusive.


# 17 Unsafe Operations
Functions provided by [racket/unsafe/ops]() are unsafe. They have certain constraints, but the constraints are not checked, which allows the system to generate and execute faster code. If arguments violate an unsafe function’s constraints, the function’s behavior and result is unpredictable, and the entire system can crash or become corrupted.
All of the exported bindings of [racket/unsafe/ops]() are protected in the sense of [protect-out](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._protect-out%29%29), so access to unsafe operations can be prevented by adjusting the code inspector (see [Code Inspectors](modprotect.html)).


### 17.1 Unsafe Numeric Operations
> ```
(unsafe-fx+ a ...) → fixnum?
  a : fixnum?
(unsafe-fx- a b ...)  →  fixnum?
  a : fixnum?
  b : fixnum?
(unsafe-fx* a ...)  →  fixnum?
  a : fixnum?
(unsafe-fxquotient a b)  →  fixnum?
  a : fixnum?
  b : fixnum?
(unsafe-fxremainder a b)  →  fixnum?
  a : fixnum?
  b : fixnum?
(unsafe-fxmodulo a b)  →  fixnum?
  a : fixnum?
  b : fixnum?
(unsafe-fxabs a)  →  fixnum?
  a : fixnum?
```
For fixnums: Unchecked versions of fx+, fx-, fx*, fxquotient, fxremainder, fxmodulo, and fxabs.

Changed in version 7.0.0.13 of package base: Allow zero or more arguments for unsafe-fx+ and unsafe-fx* and allow one or more arguments for unsafe-fx-.

> ```
(unsafe-fxand a ...) → fixnum?
  a : fixnum?

(unsafe-fxior a ...)   →   fixnum?
  a : fixnum?

(unsafe-fxxor a ...)   →   fixnum?
  a : fixnum?

(unsafe-fxnot a)   →   fixnum?
  a : fixnum?

(unsafe-fxlshift a b)   →   fixnum?
  a : fixnum?
  b : fixnum?

(unsafe-fxrshift a b)   →   fixnum?
  a : fixnum?
  b : fixnum?

(unsafe-fxrshift/logical a b)   →   fixnum?
  a : fixnum?
  b : fixnum?```

For [fixnums](numbers.html#%28tech._fixnum%29): Unchecked versions of [fxand](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxand%29%29), [fxior](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxior%29%29), [fxxor](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxxor%29%29), [fxnot](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxnot%29%29), [fxlshift](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxlshift%29%29), [fxrshift](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxrshift%29%29), and [fxrshift/logical](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxrshift%2Flogical%29%29).

Changed in version 7.0.0.13 of package base: Allow zero or more arguments for [unsafe-fxand](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fxand%29%29), [unsafe-fxior](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fxior%29%29), and [unsafe-fxxor](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fxxor%29%29).
Changed in version 8.8.0.5: Added [unsafe-fxrshift/logical](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fxrshift%2Flogical%29%29).

> ```
(unsafe-fxpopcount a)  →  fixnum?
  a : (and/c fixnum? (not/c negative?))

(unsafe-fxpopcount32 a)  →  fixnum?
  a : (and/c fixnum? (integer-in 0 #xFFFFFFFF))

(unsafe-fxpopcount16 a)  →  fixnum?
  a : (and/c fixnum? (integer-in 0 #xFFFF))
```


### 17.1 Unsafe Numeric Operations
For fixnums: Unchecked versions of fxpopcount, fxpopcount32, and fxpopcount16.
Added in version 8.5.0.6 of package base.
> ```
(unsafe-fx+/wraparound a b) → fixnum?
  a : fixnum?
  b : fixnum?
(unsafe-fx-/wraparound [a] b)   →   fixnum?
  a : fixnum? = 0
  b : fixnum?
(unsafe-fx*/wraparound a b)   →   fixnum?
  a : fixnum?
  b : fixnum?
(unsafe-fxlshift/wraparound a b)   →   fixnum?
  a : fixnum?
  b : fixnum?```
For [fixnums](numbers.html#%28tech._fixnum%29): Unchecked versions of [fx+/wraparound](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fx%2B%2Fwraparound%29%29), [fx-/wraparound](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fx-%2Fwraparound%29%29), [fx*/wraparound](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fx%2A%2Fwraparound%29%29), and [fxlshift/wraparound](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxlshift%2Fwraparound%29%29).
Added in version 7.9.0.6 of package base.
Changed in version 8.15.0.12: Changed [unsafe-fx-/wraparound](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fx-%2Fwraparound%29%29) to accept a single argument.
> ```
(unsafe-fx= a b ...) → boolean?
  a : fixnum?
  b : fixnum?
([unsafe-fx
(unsafe-fx> a b ...)  →  boolean?
  a : fixnum?
  b : fixnum?
([unsafe-fx
(unsafe-fx>= a b ...)  →  boolean?
  a : fixnum?
  b : fixnum?
(unsafe-fxmin a b ...)  →  fixnum?
  a : fixnum?
  b : fixnum?
(unsafe-fxmax a b ...)  →  fixnum?
  a : fixnum?
  b : fixnum?


### 17.1 Unsafe Numeric Operations
```
For fixnums: Unchecked versions of fx=, fx<, fx>, fx<=, fx>=, fxmin, and fxmax.

Changed in version 7.0.0.13 of package base: Allow one or more argument, instead of allowing just two.

> ```
(unsafe-fl+ a ...) → flonum?
  a : flonum?

(unsafe-fl- a b ...)   →   flonum?
  a : flonum?
  b : flonum?

(unsafe-fl* a ...)   →   flonum?
  a : flonum?

(unsafe-fl/ a b ...)   →   flonum?
  a : flonum?
  b : flonum?

(unsafe-flabs a)   →   flonum?
  a : flonum?```

For [flonums](numbers.html#%28tech._flonum%29): Unchecked versions of [fl+](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._fl%2B%29%29), [fl-](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._fl-%29%29), [fl*](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._fl%2A%29%29), [fl/](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._fl%2F%29%29), and [flabs](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flabs%29%29).

Changed in version 7.0.0.13 of package base: Allow zero or more arguments for [unsafe-fl+](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fl%2B%29%29) and [unsafe-fl*](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fl%2A%29%29) and one or more arguments for [unsafe-fl-](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fl-%29%29) and [unsafe-fl/](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fl%2F%29%29).

> ```
(unsafe-fl= a b ...) → boolean?
  a : flonum?
  b : flonum?

([unsafe-fl

(unsafe-fl> a b ...)  →  boolean?
  a : flonum?
  b : flonum?

([unsafe-fl

(unsafe-fl>= a b ...)  →  boolean?
  a : flonum?
  b : flonum?

(unsafe-flmin a b ...)  →  flonum?
  a : flonum?
  b : flonum?

(unsafe-flmax a b ...)  →  flonum?
  a : flonum?
  b : flonum?
```


### 17.1 Unsafe Numeric Operations
For flonums: Unchecked versions of fl=, fl<, fl>, fl<=, fl>=, flmin, and flmax.
Changed in version 7.0.0.13 of package base: Allow one or more argument, instead of allowing just two.
> ```
(unsafe-flround a) → flonum?
  a : flonum?
(unsafe-flfloor a)   →   flonum?
  a : flonum?
(unsafe-flceiling a)   →   flonum?
  a : flonum?
(unsafe-fltruncate a)   →   flonum?
  a : flonum?```
For [flonums](numbers.html#%28tech._flonum%29): Unchecked (potentially) versions of [flround](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flround%29%29), [flfloor](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flfloor%29%29), [flceiling](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flceiling%29%29), and [fltruncate](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._fltruncate%29%29). Currently, these bindings are simply aliases for the corresponding safe bindings.
> ```
(unsafe-flsingle a)  →  flonum?
  a : flonum?


### 17.1 Unsafe Numeric Operations
```
For flonums: Unchecked (potentially) version of flsingle.

Added in version 7.8.0.7 of package base.

> ```
(flbit-field a start end)   →   exact-nonnegative-integer?
  a : flonum?
  start : (integer-in 0 64)
  end : (integer-in 0 64)```

For [flonums](numbers.html#%28tech._flonum%29): Unchecked version of [flbit-field](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flbit-field%29%29).

Added in version 7.8.0.7 of package base.

> ```
(unsafe-flsin a)  →  flonum?
  a : flonum?

(unsafe-flcos a)  →  flonum?
  a : flonum?

(unsafe-fltan a)  →  flonum?
  a : flonum?

(unsafe-flasin a)  →  flonum?
  a : flonum?

(unsafe-flacos a)  →  flonum?
  a : flonum?

(unsafe-flatan a)  →  flonum?
  a : flonum?

(unsafe-fllog a)  →  flonum?
  a : flonum?

(unsafe-flexp a)  →  flonum?
  a : flonum?

(unsafe-flsqrt a)  →  flonum?
  a : flonum?

(unsafe-flexpt a b)  →  flonum?
  a : flonum?
  b : flonum?
```
For flonums: Unchecked (potentially) versions of flsin, flcos, fltan, flasin, flacos, flatan, fllog, flexp, flsqrt, and flexpt. Currently, some of these bindings are simply aliases for the corresponding safe bindings.
> ```
(unsafe-make-flrectangular a b)
   →    ( and/c complex?
> ( lambda ( c ) ( flonum? ( real-part c ) ) )
> ( lambda ( c ) ( flonum? ( imag-part c ) ) ) )
  a : flonum?
  b : flonum?
(unsafe-flreal-part a)   →   flonum?
   a   :   ( and/c complex?
> ( lambda ( c ) ( flonum? ( real-part c ) ) )
> ( lambda ( c ) ( flonum? ( imag-part c ) ) ) )
(unsafe-flimag-part a)   →   flonum?
   a   :   ( and/c complex?


### 17.1 Unsafe Numeric Operations
> ( lambda ( c ) ( flonum? ( real-part c ) ) )
> ( lambda ( c ) ( flonum? ( imag-part c ) ) ) )```
For [flonums](numbers.html#%28tech._flonum%29): Unchecked versions of [make-flrectangular](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._make-flrectangular%29%29), [flreal-part](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flreal-part%29%29), and [flimag-part](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flimag-part%29%29).
> ```
(unsafe-fx  →  fl a)  →  flonum?
  a : fixnum?
(unsafe-fl  →  fx a)  →  fixnum?
  a : flonum?
```
Unchecked versions of fx  →  fl and fl  →  fx.

Changed in version 7.7.0.8 of package base: Changed unsafe-fl  →  fx to truncate.

> ```
(unsafe-flrandom rand-gen)   →   (and flonum? (>/c 0) ([```

Unchecked version of [flrandom](flonums.html#%28def._%28%28lib._racket%2Fflonum..rkt%29._flrandom%29%29).

### 17.2 Unsafe Character Operations

> ```
(unsafe-char=? a b ...) → boolean?
  a : char?
  b : char?

([unsafe-char

(unsafe-char>? a b ...)  →  boolean?
  a : char?
  b : char?

([unsafe-char

(unsafe-char>=? a b ...)  →  boolean?
  a : char?
  b : char?

(unsafe-char  →  integer a)  →  fixnum?
  a : char?
```
(parameter)	→
(-> parameter)```


### 17.1 Unsafe Numeric Operations
Unsafe variants of [car](pairs.html#%28def._%28%28quote._~23~25kernel%29._car%29%29), [cdr](pairs.html#%28def._%28%28quote._~23~25kernel%29._cdr%29%29), [mcar](mpairs.html#%28def._%28%28quote._~23~25kernel%29._mcar%29%29), [mcdr](mpairs.html#%28def._%28%28quote._~23~25kernel%29._mcdr%29%29), [set-mcar!](mpairs.html#%28def._%28%28quote._~23~25kernel%29._set-mcar%21%29%29), and [set-mcdr!](mpairs.html#%28def._%28%28quote._~23~25kernel%29._set-mcdr%21%29%29).
> ```
(unsafe-cons-list v rest)  →  (and/c pair? list?)
  v : any/c
  rest : list?
```
Unsafe variant of cons that produces a pair that claims to be a list—without checking whether rest is a list.

> ```
(unsafe-list-ref lst pos)   →   any/c
  lst : pair?
  pos : (and/c exact-nonnegative-integer? fixnum?)

(unsafe-list-tail lst pos)   →   any/c
  lst : any/c
  pos : (and/c exact-nonnegative-integer? fixnum?)```

Unsafe variants of [list-ref](pairs.html#%28def._%28%28quote._~23~25kernel%29._list-ref%29%29) and [list-tail](pairs.html#%28def._%28%28quote._~23~25kernel%29._list-tail%29%29), where pos must be a [fixnum](numbers.html#%28tech._fixnum%29), and lst must start with at least ([add1](generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._add1%29%29) pos) (for [unsafe-list-ref](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-list-ref%29%29)) or pos (for [unsafe-list-tail](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-list-tail%29%29)) pairs.

> ```
(parameter)	→
(-> unsafe-set-immutable-cdr! p v)
```
(parameter)	→
(-> unsafe-set-box! b k)```


### 17.1 Unsafe Numeric Operations
Unsafe versions of [unbox](boxes.html#%28def._%28%28quote._~23~25kernel%29._unbox%29%29) and [set-box!](boxes.html#%28def._%28%28quote._~23~25kernel%29._set-box%21%29%29), where the box\* variants can be faster but do not work on [impersonators](chaperones.html#%28tech._impersonator%29).
> ```
(unsafe-box*-cas! loc old new)  →  boolean?
  loc : box?
  old : any/c
  new : any/c
```
(parameter)	→
(-> unsafe-vector-ref v k)```

Unsafe versions of [vector-length](vectors.html#%28def._%28%28quote._~23~25kernel%29._vector-length%29%29), [vector-ref](vectors.html#%28def._%28%28quote._~23~25kernel%29._vector-ref%29%29), [vector-set!](vectors.html#%28def._%28%28quote._~23~25kernel%29._vector-set%21%29%29), [vector-cas!](vectors.html#%28def._%28%28quote._~23~25kernel%29._vector-cas%21%29%29), [vector-copy](vectors.html#%28def._%28%28lib._racket%2Fvector..rkt%29._vector-copy%29%29), [vector-set/copy](vectors.html#%28def._%28%28lib._racket%2Fvector..rkt%29._vector-set%2Fcopy%29%29), and [vector-append](vectors.html#%28def._%28%28lib._racket%2Fvector..rkt%29._vector-append%29%29), where the vector\* variants can be faster but do not work on [impersonators](chaperones.html#%28tech._impersonator%29).

A vector’s size can never be larger than a [fixnum](numbers.html#%28tech._fixnum%29), so even [vector-length](vectors.html#%28def._%28%28quote._~23~25kernel%29._vector-length%29%29) always returns a fixnum.

Changed in version 6.11.0.2 of package base: Added [unsafe-vector*-cas!](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-vector%2A-cas%21%29%29).
Changed in version 8.11.1.9: Added [unsafe-vector-copy](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-vector-copy%29%29), [unsafe-vector*-copy](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-vector%2A-copy%29%29), [unsafe-vector-set/copy](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-vector-set%2Fcopy%29%29), [unsafe-vector*-set/copy](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-vector%2A-set%2Fcopy%29%29), [unsafe-vector-append](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-vector-append%29%29), and [unsafe-vector*-append](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-vector%2A-append%29%29).

> ```
(unsafe-vector*  →  immutable-vector! v)
  →  (and/c vector? immutable?)
  v : (and/c vector? (not/c impersonator?))
```


### 17.1 Unsafe Numeric Operations
Similar to vector  →  immutable-vector, but potentially destroys v and reuses it space, so v must not be used after calling unsafe-vector*  →  immutable-vector!.
Added in version 7.7.0.6 of package base.
> ```
(ch)	 →
(  →  unsafe-string-ref str k)```
Unsafe versions of [string-length](strings.html#%28def._%28%28quote._~23~25kernel%29._string-length%29%29), [string-ref](strings.html#%28def._%28%28quote._~23~25kernel%29._string-ref%29%29), and [string-set!](strings.html#%28def._%28%28quote._~23~25kernel%29._string-set%21%29%29). The [unsafe-string-ref](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-string-ref%29%29) procedure can be used only when the result will be a Latin-1 character. A string’s size can never be larger than a [fixnum](numbers.html#%28tech._fixnum%29) (so even [string-length](strings.html#%28def._%28%28quote._~23~25kernel%29._string-length%29%29) always returns a fixnum).
> ```
(unsafe-string  →  immutable-string! str)
  →  (and/c string? immutable?)
  str : string?


### 17.1 Unsafe Numeric Operations
```
(parameter)	→
(-> parameter)```

Unsafe versions of [bytes-length](bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes-length%29%29), [bytes-ref](bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes-ref%29%29), [bytes-set!](bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes-set%21%29%29), and [bytes-copy!](bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes-copy%21%29%29). A bytes’s size can never be larger than a [fixnum](numbers.html#%28tech._fixnum%29) (so even [bytes-length](bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes-length%29%29) always returns a fixnum).

Changed in version 7.5.0.15 of package base: Added [unsafe-bytes-copy!](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-bytes-copy%21%29%29).

> ```
(unsafe-bytes  →  immutable-bytes! bstr)
  →  (and/c bytes? immutable?)
  bstr : bytes?
```
(parameter)	→
(-> parameter)```
Unsafe versions of [fxvector-length](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxvector-length%29%29), [fxvector-ref](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxvector-ref%29%29), and [fxvector-set!](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxvector-set%21%29%29). A [fxvector](fixnums.html#%28tech._fxvector%29)’s size can never be larger than a [fixnum](numbers.html#%28tech._fixnum%29) (so even [fxvector-length](fixnums.html#%28def._%28%28lib._racket%2Ffixnum..rkt%29._fxvector-length%29%29) always returns a fixnum).
> ```
(parameter)	→
(-> unsafe-flvector-ref v k)


### 17.1 Unsafe Numeric Operations
```
(parameter)	→
(-> unsafe-f64vector-set! vec k n)```

Unsafe versions of [f64vector-ref](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=foreign&rel=homogeneous-vectors.html%23%2528def._%2528%2528lib._ffi%252Fvector..rkt%2529._f64vector-ref%2529%2529&version=8.18.0.13) and [f64vector-set!](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=foreign&rel=homogeneous-vectors.html%23%2528def._%2528%2528lib._ffi%252Fvector..rkt%2529._f64vector-set%2521%2529%2529&version=8.18.0.13).

> ```
(parameter)	→
(-> integer-in -32768 32767)
```
(parameter)	→
(-> integer-in 0 65535)```
Unsafe versions of [u16vector-ref](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=foreign&rel=homogeneous-vectors.html%23%2528def._%2528%2528lib._ffi%252Fvector..rkt%2529._u16vector-ref%2529%2529&version=8.18.0.13) and [u16vector-set!](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=foreign&rel=homogeneous-vectors.html%23%2528def._%2528%2528lib._ffi%252Fvector..rkt%2529._u16vector-set%2521%2529%2529&version=8.18.0.13).
> ```
(stencil-vector-mask-width)	→
(-> integer-in 0 (sub1 (expt 2 (stencil-vector-mask-width))))


### 17.1 Unsafe Numeric Operations
```
(parameter)	→
(-> unsafe-struct-set! v k val)```

Unsafe field access and update for an instance of a structure type, where the struct\* variants can be faster but do not work on [impersonators](chaperones.html#%28tech._impersonator%29). The index k must be between 0 (inclusive) and the number of fields in the structure (exclusive). In the case of [unsafe-struct-set!](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-struct-set%21%29%29), [unsafe-struct*-set!](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-struct%2A-set%21%29%29), and [unsafe-struct*-cas!](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-struct%2A-cas%21%29%29), the field must be mutable. The [unsafe-struct*-cas!](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-struct%2A-cas%21%29%29) operation is analogous to [box-cas!](boxes.html#%28def._%28%28quote._~23~25kernel%29._box-cas%21%29%29) to perform an atomic compare-and-set.

Changed in version 6.11.0.2 of package base: Added [unsafe-struct*-cas!](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-struct%2A-cas%21%29%29).

> ```
(unsafe-struct*-type v)  →  struct-type?
  v : any/c
```
Similar to struct-info, but without an inspector check, returning only the first result, and without support for impersonators.
Added in version 8.8.0.3 of package base.
> ```
(unsafe-mutable-hash-iterate-first hash)   →   (or/c #f any/c)
  hash : (and/c hash? (not/c immutable?) hash-strong?)


### 17.1 Unsafe Numeric Operations
(unsafe-mutable-hash-iterate-next hash pos)   →   (or/c #f any/c)
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
(unsafe-mutable-hash-iterate-key hash pos)   →   any/c
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
(unsafe-mutable-hash-iterate-key   hash
    pos
    bad-index-v)    →    any/c
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
  bad-index-v : any/c
(unsafe-mutable-hash-iterate-value   hash
    pos)    →    any/c
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
(unsafe-mutable-hash-iterate-value   hash
    pos
    bad-index-v)    →    any/c
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
  bad-index-v : any/c
(unsafe-mutable-hash-iterate-key+value   hash
    pos)    →    any/c   any/c
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
(unsafe-mutable-hash-iterate-key+value   hash
    pos
    bad-index-v)
   →    any/c   any/c
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
  bad-index-v : any/c
(unsafe-mutable-hash-iterate-pair hash pos)   →   pair?
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
(unsafe-mutable-hash-iterate-pair   hash
    pos
    bad-index-v)    →    pair?
  hash : (and/c hash? (not/c immutable?) hash-strong?)
  pos : any/c
  bad-index-v : any/c
(unsafe-immutable-hash-iterate-first hash)   →   (or/c #f any/c)
  hash : (and/c hash? immutable?)


### 17.1 Unsafe Numeric Operations
(unsafe-immutable-hash-iterate-next   hash
    pos)    →    (or/c #f any/c)
  hash : (and/c hash? immutable?)
  pos : any/c
(unsafe-immutable-hash-iterate-key   hash
    pos)    →    any/c
  hash : (and/c hash? immutable?)
  pos : any/c
(unsafe-immutable-hash-iterate-key   hash
    pos
    bad-index-v)    →    any/c
  hash : (and/c hash? immutable?)
  pos : any/c
  bad-index-v : any/c
(unsafe-immutable-hash-iterate-value   hash
    pos)    →    any/c
  hash : (and/c hash? immutable?)
  pos : any/c
(unsafe-immutable-hash-iterate-value   hash
    pos
    bad-index-v)    →    any/c
  hash : (and/c hash? immutable?)
  pos : any/c
  bad-index-v : any/c
(unsafe-immutable-hash-iterate-key+value   hash
    pos)    →    any/c   any/c
  hash : (and/c hash? immutable?)
  pos : any/c
(unsafe-immutable-hash-iterate-key+value   hash
    pos
    bad-index-v)
   →    any/c   any/c
  hash : (and/c hash? immutable?)
  pos : any/c
  bad-index-v : any/c
(unsafe-immutable-hash-iterate-pair   hash
    pos)    →    pair?
  hash : (and/c hash? immutable?)
  pos : any/c
(unsafe-immutable-hash-iterate-pair   hash
    pos
    bad-index-v)    →    pair?
  hash : (and/c hash? immutable?)
  pos : any/c
  bad-index-v : any/c
(unsafe-weak-hash-iterate-first hash)   →   (or/c #f any/c)
  hash : (and/c hash? hash-weak?)
(unsafe-weak-hash-iterate-next hash pos)   →   (or/c #f any/c)
  hash : (and/c hash? hash-weak?)
  pos : any/c


### 17.1 Unsafe Numeric Operations
(unsafe-weak-hash-iterate-key hash pos)   →   any/c
  hash : (and/c hash? hash-weak?)
  pos : any/c
(unsafe-weak-hash-iterate-key   hash
    pos
    bad-index-v)    →    any/c
  hash : (and/c hash? hash-weak?)
  pos : any/c
  bad-index-v : any/c
(unsafe-weak-hash-iterate-value hash pos)   →   any/c
  hash : (and/c hash? hash-weak?)
  pos : any/c
(unsafe-weak-hash-iterate-value   hash
    pos
    bad-index-v)    →    any/c
  hash : (and/c hash? hash-weak?)
  pos : any/c
  bad-index-v : any/c
(unsafe-weak-hash-iterate-key+value   hash
    pos)    →    any/c   any/c
  hash : (and/c hash? hash-weak?)
  pos : any/c
(unsafe-weak-hash-iterate-key+value   hash
    pos
    bad-index-v)    →    any/c   any/c
  hash : (and/c hash? hash-weak?)
  pos : any/c
  bad-index-v : any/c
(unsafe-weak-hash-iterate-pair hash pos)   →   pair?
  hash : (and/c hash? hash-weak?)
  pos : any/c
(unsafe-weak-hash-iterate-pair   hash
    pos
    bad-index-v)    →    pair?
  hash : (and/c hash? hash-weak?)
  pos : any/c
  bad-index-v : any/c
(unsafe-ephemeron-hash-iterate-first hash)   →   (or/c #f any/c)
  hash : (and/c hash? hash-ephemeron?)
(unsafe-ephemeron-hash-iterate-next   hash
    pos)    →    (or/c #f any/c)
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
(unsafe-ephemeron-hash-iterate-key   hash
    pos)    →    any/c
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
(unsafe-ephemeron-hash-iterate-key   hash
    pos
    bad-index-v)    →    any/c


### 17.1 Unsafe Numeric Operations
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
  bad-index-v : any/c
(unsafe-ephemeron-hash-iterate-value   hash
    pos)    →    any/c
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
(unsafe-ephemeron-hash-iterate-value   hash
    pos
    bad-index-v)    →    any/c
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
  bad-index-v : any/c
(unsafe-ephemeron-hash-iterate-key+value   hash
    pos)    →    any/c   any/c
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
(unsafe-ephemeron-hash-iterate-key+value   hash
    pos
    bad-index-v)
   →    any/c   any/c
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
  bad-index-v : any/c
(unsafe-ephemeron-hash-iterate-pair   hash
    pos)    →    pair?
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
(unsafe-ephemeron-hash-iterate-pair   hash
    pos
    bad-index-v)    →    pair?
  hash : (and/c hash? hash-ephemeron?)
  pos : any/c
  bad-index-v : any/c```
Unsafe versions of [hash-iterate-key](hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash-iterate-key%29%29) and similar procedures. These operations support [chaperones](chaperones.html#%28tech._chaperone%29) and [impersonators](chaperones.html#%28tech._impersonator%29).


### 17.1 Unsafe Numeric Operations
Each unsafe ...-first and ...-next procedure may return, instead of a number index, an internal representation of a view into the hash structure, enabling faster iteration. The result of these ...-first and ...-next functions should be given as pos to the corresponding unsafe accessor functions.
If the pos provided to an accessor function for a mutable hash was formerly a [valid hash index](hashtables.html#%28tech._valid._hash._index%29) but is no longer a [valid hash index](hashtables.html#%28tech._valid._hash._index%29) for hash, and if bad-index-v is not provided, then the [exn:fail:contract](exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29) exception is raised. No behavior is specified for a pos that was never a [valid hash index](hashtables.html#%28tech._valid._hash._index%29) for hash. Note that bad-index-v argument is technically not useful for the unsafe-immutable-hash-iterate- functions, since an index cannot become invalid for an immutable hash.
Added in version 6.4.0.6 of package base.
Changed in version 7.0.0.10: Added the optional bad-index-v argument.
Changed in version 8.0.0.10: Added ephemeron variants.
> ```
(unsafe-make-srcloc   source
    line
    column
    position
    span)    →    srcloc?
  source : any/c
  line : (or/c exact-positive-integer? #f)
  column : (or/c exact-nonnegative-integer? #f)
  position : (or/c exact-positive-integer? #f)
  span : (or/c exact-nonnegative-integer? #f)


### 17.1 Unsafe Numeric Operations
```
Unsafe version of srcloc.

Added in version 7.2.0.10 of package base.

### 17.4 Unsafe Extflonum Operations

> ```
(unsafe-extfl+ a b)   →   extflonum?
  a : extflonum?
  b : extflonum?

(unsafe-extfl- a b)   →   extflonum?
  a : extflonum?
  b : extflonum?

(unsafe-extfl* a b)   →   extflonum?
  a : extflonum?
  b : extflonum?

(unsafe-extfl/ a b)   →   extflonum?
  a : extflonum?
  b : extflonum?

(unsafe-extflabs a)   →   extflonum?
  a : extflonum?```

Unchecked versions of [extfl+](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extfl%2B%29%29), [extfl-](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extfl-%29%29), [extfl*](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extfl%2A%29%29), [extfl/](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extfl%2F%29%29), and [extflabs](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extflabs%29%29).

> ```
(unsafe-extfl= a b) → boolean?
  a : extflonum?
  b : extflonum?

([unsafe-extfl

(unsafe-extfl> a b)  →  boolean?
  a : extflonum?
  b : extflonum?

([unsafe-extfl

(unsafe-extfl>= a b)  →  boolean?
  a : extflonum?
  b : extflonum?

(unsafe-extflmin a b)  →  extflonum?
  a : extflonum?
  b : extflonum?

(unsafe-extflmax a b)  →  extflonum?
  a : extflonum?
  b : extflonum?
```
Unchecked versions of extfl=, extfl<, extfl>, extfl<=, extfl>=, extflmin, and extflmax.
> ```
(unsafe-extflround a) → extflonum?
  a : extflonum?
(unsafe-extflfloor a)   →   extflonum?
  a : extflonum?


### 17.1 Unsafe Numeric Operations
(unsafe-extflceiling a)   →   extflonum?
  a : extflonum?
(unsafe-extfltruncate a)   →   extflonum?
  a : extflonum?```
Unchecked (potentially) versions of [extflround](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extflround%29%29), [extflfloor](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extflfloor%29%29), [extflceiling](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extflceiling%29%29), and [extfltruncate](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extfltruncate%29%29). Currently, these bindings are simply aliases for the corresponding safe bindings.
> ```
(unsafe-extflsin a)  →  extflonum?
  a : extflonum?
(unsafe-extflcos a)  →  extflonum?
  a : extflonum?
(unsafe-extfltan a)  →  extflonum?
  a : extflonum?
(unsafe-extflasin a)  →  extflonum?
  a : extflonum?
(unsafe-extflacos a)  →  extflonum?
  a : extflonum?
(unsafe-extflatan a)  →  extflonum?
  a : extflonum?
(unsafe-extfllog a)  →  extflonum?
  a : extflonum?
(unsafe-extflexp a)  →  extflonum?
  a : extflonum?
(unsafe-extflsqrt a)  →  extflonum?
  a : extflonum?
(unsafe-extflexpt a b)  →  extflonum?
  a : extflonum?
  b : extflonum?


### 17.1 Unsafe Numeric Operations
```
Unchecked (potentially) versions of extflsin, extflcos, extfltan, extflasin, extflacos, extflatan, extfllog, extflexp, extflsqrt, and extflexpt. Currently, some of these bindings are simply aliases for the corresponding safe bindings.

> ```
(unsafe-fx  →  extfl a)   →   extflonum?
  a : fixnum?

(unsafe-extfl  →  fx a)   →   fixnum?
  a : extflonum?```

Unchecked (potentially) versions of [fx->extfl](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._fx-~3eextfl%29%29) and [extfl->fx](extflonums.html#%28def._%28%28lib._racket%2Fextflonum..rkt%29._extfl-~3efx%29%29).

Changed in version 7.7.0.8 of package base: Changed [unsafe-fl->fx](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-fl-~3efx%29%29) to truncate.

> ```
(parameter)	→
(-> unsafe-extflvector-ref v k)
```
Unchecked versions of extflvector-length, extflvector-ref, and extflvector-set!. A extflvector’s size can never be larger than a fixnum (so even extflvector-length always returns a fixnum).


### 17.5 Unsafe Impersonators and Chaperones
> ```
(unsafe-impersonate-procedure proc
    replacement-proc
    prop
    prop-val ...
    ...)
   →   (and/c procedure? impersonator?)
  proc : procedure?
  replacement-proc : procedure?
  prop : impersonator-property?
  prop-val : any```
Like [impersonate-procedure](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%29%29), but assumes that replacement-proc calls proc itself. When the result of [unsafe-impersonate-procedure](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-procedure%29%29) is applied to arguments, the arguments are passed on to replacement-proc directly, ignoring proc. At the same time, [impersonator-of?](chaperones.html#%28def._%28%28quote._~23~25kernel%29._impersonator-of~3f%29%29) reports #t when given the result of [unsafe-impersonate-procedure](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-procedure%29%29) and proc.


### 17.5 Unsafe Impersonators and Chaperones
If proc is itself an impersonator that is derived from [impersonate-procedure*](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%2A%29%29) or [chaperone-procedure*](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._chaperone-procedure%2A%29%29), beware that replacement-proc will not be able to call it correctly. Specifically, the impersonator produced by [unsafe-impersonate-procedure](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-procedure%29%29) will not get passed to a wrapper procedure that was supplied to [impersonate-procedure*](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%2A%29%29) or [chaperone-procedure*](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._chaperone-procedure%2A%29%29) to generate proc.
Finally, unlike [impersonate-procedure](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%29%29), [unsafe-impersonate-procedure](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-procedure%29%29) does not specially handle [impersonator-prop:application-mark](chaperones.html#%28def._%28%28quote._~23~25kernel%29._impersonator-prop~3aapplication-mark%29%29) as a prop.


### 17.5 Unsafe Impersonators and Chaperones
The unsafety of [unsafe-impersonate-procedure](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-procedure%29%29) is limited to the above differences from [impersonate-procedure](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%29%29). The contracts on the arguments of [unsafe-impersonate-procedure](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-procedure%29%29) are checked when the arguments are supplied.
As an example, assuming that f accepts a single argument and is not derived from [impersonate-procedure*](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%2A%29%29) or [chaperone-procedure*](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._chaperone-procedure%2A%29%29), then
> ```racket
> ( λ ( f )
> ( unsafe-impersonate-procedure
> f
> ( λ ( x )
> ( if ( number? x )
> ( error ' no-numbers! )
> ( f x ) ) ) ) )
> ```
is equivalent to
> ```racket
> ( λ ( f )
> ( impersonate-procedure
> f
> ( λ ( x )
> ( if ( number? x )
> ( error ' no-numbers! )
> x ) ) ) )
> ```


### 17.5 Unsafe Impersonators and Chaperones
Similarly, with the same assumptions about f, the following two procedures wrap-f1 and wrap-f2 are almost equivalent; they differ only in the error message produced when their arguments are functions that return multiple values (and that they update different global variables). The version using [unsafe-impersonate-procedure](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-procedure%29%29) will signal an error in the [let](let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._let%29%29) expression about multiple return values, whereas the one using [impersonate-procedure](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%29%29) signals an error from [impersonate-procedure](chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%29%29) about multiple return values.
> ```racket
> ( define log1-args ' ( ) )
> ( define log1-results ' ( ) )
> ( define wrap-f1
> ( λ ( f )
> ( impersonate-procedure
> f
> ( λ ( arg )
> ( set! log1-args ( cons arg log1-args ) )
> ( values ( λ ( res )
> ( set! log1-results ( cons res log1-results ) )
> res )
> arg ) ) ) ) )
> ( define log2-args ' ( ) )
> ( define log2-results ' ( ) )
> ( define wrap-f2
> ( λ ( f )
> ( unsafe-impersonate-procedure
> f
> ( λ ( arg )
> ( set! log2-args ( cons arg log2-args ) )
> ( let ( [ res ( f arg ) ] )
> ( set! log2-results ( cons res log2-results ) )
> res ) ) ) ) )
> ```
Added in version 6.4.0.4 of package base.
> ```


### 17.5 Unsafe Impersonators and Chaperones
(unsafe-chaperone-procedure proc
    wrapper-proc
    prop
    prop-val ...
    ...)
  →  (and/c procedure? chaperone?)
  proc : procedure?
  wrapper-proc : procedure?
  prop : impersonator-property?
  prop-val : any
```
Like unsafe-impersonate-procedure, but creates a chaperone. Since wrapper-proc will be called in lieu of proc, wrapper-proc is assumed to return a chaperone of the value that proc would return.

Added in version 6.4.0.4 of package base.

> ```
(unsafe-impersonate-vector vec
    replacement-vec
    prop
    prop-val ...
    ...)

   →   (and/c vector? impersonator?)
  vec : vector?
  replacement-vec : (and/c vector? (not/c impersonator?))
  prop : impersonator-property?
  prop-val : any/c```

Like [impersonate-vector](chaperones.html#%28def._%28%28quote._~23~25kernel%29._impersonate-vector%29%29), but instead of going through interposition procedures, all accesses to the impersonator are dispatched to replacement-vec.

The result of [unsafe-impersonate-vector](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-impersonate-vector%29%29) is an impersonator of vec.

Added in version 6.9.0.2 of package base.

> ```
(unsafe-chaperone-vector vec
    replacement-vec
    prop
    prop-val ...
    ...)

  →  (and/c vector? chaperone?)
  vec : vector?
  replacement-vec : (and/c vector? (not/c impersonator?))
  prop : impersonator-property?
  prop-val : any/c
```
Like unsafe-impersonate-vector, but the result of unsafe-chaperone-vector is a chaperone of vec.


### 17.5 Unsafe Impersonators and Chaperones
Added in version 6.9.0.2 of package base.


### 17.6 Unsafe Assertions
> ```
(unsafe-assert-unreachable)   →   none/c```
Like [assert-unreachable](unreachable.html#%28def._%28%28quote._~23~25kernel%29._assert-unreachable%29%29), but the contract of [unsafe-assert-unreachable](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-assert-unreachable%29%29) is never satisfied, and the “unsafe” implication is that anything at all can happen if a call to [unsafe-assert-unreachable](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-assert-unreachable%29%29) is reached.
The compiler may take advantage of its liberty to pick convenient or efficient behavior in place of a call to [unsafe-assert-unreachable](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-assert-unreachable%29%29). For example, the expression
> ```racket
> ( lambda ( x )
> ( if ( pair? x )
> ( car x )
> ( unsafe-assert-unreachable ) ) )
> ```
may be compiled to code equivalent to
> ([lambda](lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29) (x) ([unsafe-car](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-car%29%29) x))
because choosing to make ([unsafe-assert-unreachable](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-assert-unreachable%29%29)) behave the same as ([unsafe-car](#%28def._%28%28lib._racket%2Funsafe%2Fops..rkt%29._unsafe-car%29%29) x) makes both branches of the [if](if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29) the same, and then [pair?](pairs.html#%28def._%28%28quote._~23~25kernel%29._pair~3f%29%29) test can be eliminated.


### 17.6 Unsafe Assertions
Added in version 8.0.0.11 of package base.


### 17.7 Unsafe Undefined
|                                                                                |                                                                                |
|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------:|
|  ([require](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29) [racket/unsafe/undefined](#%28mod-path._racket%2Funsafe%2Fundefined%29)) |  package: [base](https://pkgs.racket-lang.org/package/base "Install this package using `raco pkg install base`") |
The bindings documented in this section are provided by the [racket/unsafe/undefined](#%28mod-path._racket%2Funsafe%2Fundefined%29) library, not [racket/base](index.html) or [racket](index.html).


### 17.7 Unsafe Undefined
The constant [unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._unsafe-undefined%29%29) is used internally as a placeholder value. For example, it is used by [letrec](let.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._letrec%29%29) as a value for a variable that has not yet been assigned a value. Unlike the undefined value exported by [racket/undefined](undefined.html), however, the [unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._unsafe-undefined%29%29) value should not leak as the result of a safe expression, and it should not be passed as an optional argument to a procedure (because it may count as “no value provided”). Expression results that potentially produce [unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._unsafe-undefined%29%29) can be guarded by [check-not-unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._check-not-unsafe-undefined%29%29), so that an exception can be raised instead of producing an undefined value.
The [unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._unsafe-undefined%29%29) value is always [eq?](Equality.html#%28def._%28%28quote._~23~25kernel%29._eq~3f%29%29) to itself.
Added in version 6.0.1.2 of package base.
Changed in version 6.90.0.29: Procedures with optional arguments sometimes use the [unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._unsafe-undefined%29%29) value internally to mean “no argument supplied.”


### 17.7 Unsafe Undefined
>
<colgroup><col style="width: 100%" /></colgroup>

value

[unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._unsafe-undefined%29%29) : [any/c](data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29)

The unsafe “undefined” constant.
See above for important constraints on the use of [unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._unsafe-undefined%29%29).
> ```
(parameter)	→
```
(parameter)	→```

The same as [check-not-unsafe-undefined](#%28def._%28%28lib._racket%2Funsafe%2Fundefined..rkt%29._check-not-unsafe-undefined%29%29), except that the error message (if any) is along the lines of “sym: undefined; assignment before initialization.”

> ```
(chaperone-struct-unsafe-undefined v)  →  any/c
  v : any/c
```
(find-config-dir)	→
(-> such as current-load-relative-directory)```
Produces a list of paths, which is normally used to initialize [current-library-collection-paths](#%28def._%28%28quote._~23~25kernel%29._current-library-collection-paths%29%29), as follows:


### 17.7 Unsafe Undefined
-   The path produced by ([build-path](Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._build-path%29%29) ([find-system-path](Filesystem.html#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29) 'addon-dir) name "collects") is the first element of the default collection path list, unless the value of the [use-user-specific-search-paths](#%28def._%28%28quote._~23~25kernel%29._use-user-specific-search-paths%29%29) parameter is #f.
-   Extra directories provided in pre-extras are included next to the default collection path list, converted to complete paths relative to the executable.
-   If the directory specified by ([find-system-path](Filesystem.html#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29) 'collects-dir) is absolute, or if it is relative (to the executable) and it exists, then it is added to the end of the default collection path list.
-   Extra directories provided in post-extras are included last in the default collection path list, converted to complete paths relative to the executable.
-   If config has a value for 'collects-search-dirs, then it is used in place of the default collection path list (as constructed by the preceding three bullets), and the default is spliced in place of any #f within the 'collects-search-dirs list. If config does not have a 'collects-search-dirs value, then the default collection path list is used.


### 17.7 Unsafe Undefined
-   If the PLTCOLLECTS environment variable is defined, it is combined with the default list using [path-list-string->path-list](Filesystem.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-list-string-~3epath-list%29%29), as long as the value of [use-user-specific-search-paths](#%28def._%28%28quote._~23~25kernel%29._use-user-specific-search-paths%29%29) is true. If it is not defined or if the value [use-user-specific-search-paths](#%28def._%28%28quote._~23~25kernel%29._use-user-specific-search-paths%29%29) is #f, the collection path list as constructed by the preceding four bullets is used directly.
    Note that on Unix and Mac OS, paths are separated by :, and on Windows by ;. Also, [path-list-string->path-list](Filesystem.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-list-string-~3epath-list%29%29) splices the default paths at an empty path, for example, with many Unix shells you can set PLTCOLLECTS to ":‘pwd‘", "‘pwd‘:", or "‘pwd‘" to specify search the current directory after, before, or instead of the default paths, respectively.
Changed in version 8.4.0.3 of package base: Added the config and name arguments.
> ```
(find-library-collection-links [config] name)
  →  (listof (or/c #f (and/c path? complete-path?)))
  config : hash? = (read-installation-configuration-table)
  name : (get-installation-name config)


### 17.7 Unsafe Undefined
```
(find-config-dir)	→
(-> regexp-match? #rx"[.]rkt$" file)```

Returns the path to the file indicated by file in the collection specified by the collections, where the second collection (if any) names a sub-collection, and so on. The search uses the values of [current-library-collection-links](#%28def._%28%28quote._~23~25kernel%29._current-library-collection-links%29%29) and [current-library-collection-paths](#%28def._%28%28quote._~23~25kernel%29._current-library-collection-paths%29%29).

> > > See also [collection-search](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=raco&rel=collection-search.html%23%2528def._%2528%2528lib._setup%252Fcollection-search..rkt%2529._collection-search%2529%2529&version=8.18.0.13) in [setup/collection-search](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=raco&rel=collection-search.html&version=8.18.0.13).

If file is not found, but file ends in ".rkt" and a file with the suffix ".ss" exists, then the directory of the ".ss" file is used. If file is not found and the ".rkt"/".ss" conversion does not apply, but a directory corresponding to the collections is found, then a path using the first such directory is returned.

If check-compiled? is true, then the search also depends on [use-compiled-file-paths](eval.html#%28def._%28%28quote._~23~25kernel%29._use-compiled-file-paths%29%29) and [current-compiled-file-roots](eval.html#%28def._%28%28quote._~23~25kernel%29._current-compiled-file-roots%29%29); if file is not found, then a compiled form of file with the suffix ".zo" is checked in the same way as the default [compiled-load handler](eval.html#%28tech._compiled._load._handler%29). If a compiled file is found, the result from [collection-file-path](#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._collection-file-path%29%29) reports the location that file itself would occupy (if it existed) for the found compiled file.

Finally, if the collection is not found, and if fail-proc is provided, then fail-proc is applied to an error message (that does not start "collection-file-path:" or otherwise claim a source), and its result is the result of [collection-file-path](#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._collection-file-path%29%29). If fail-proc is not provided and the collection is not found, then the [exn:fail:filesystem](exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3afilesystem%29%29) exception is raised.

Examples:

> ```racket
> > ( collection-file-path "main.rkt" "racket" "base" )
> #<path:path/to/collects/racket/base/main.rkt>
> > ( collection-file-path "sandwich.rkt" "bologna" )
> collection-file-path: collection not found
> collection: "bologna"
> in collection directories:
> /Users/robby/snapshot/racket/racket/collects/
> ... [260 additional linked and package directories]
> ```

Changed in version 6.0.1.12 of package base: Added the check-compiled? argument.

> ```
(collection-path collection ...+) → path?
  collection : path-string?
(collection-path   collection
    ...+
    #:fail fail-proc)    →    any

  collection : path-string?
  fail-proc : (string? .  →  . any)
```


### 17.7 Unsafe Undefined
(current-library-collection-paths)	→
(-> listof (and/c path? complete-path?))
(current-library-collection-paths paths) → void?
    paths	:
(-> listof (and/c path? complete-path?))```
Parameter that determines a list of complete directory paths for finding libraries (as referenced in [require](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29), for example) through the default [module name resolver](Module_Names_and_Loading.html#%28tech._module._name._resolver%29) and for finding paths through [collection-path](#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._collection-path%29%29) and [collection-file-path](#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._collection-file-path%29%29). See [Collection Search Configuration](#%28part._collects-search%29) for more information.
> ```
(current-library-collection-links)	→
(-> listof (or/c #f
    (and/c path? complete-path?)
    (hash/c (or/c (and/c symbol? module-path?) #f)
    (listof (and/c path? complete-path?)))))
(current-library-collection-links paths) → void?
    paths	:
(-> listof (or/c #f
    (and/c path? complete-path?)
    (hash/c (or/c (and/c symbol? module-path?) #f)
    (listof (and/c path? complete-path?)))))


### 17.7 Unsafe Undefined
```
(use-user-specific-search-paths)	→
(-> use-user-specific-search-paths on?)```

Parameter that determines whether user-specific paths, which are in the directory produced by ([find-system-path](Filesystem.html#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29) 'addon-dir), are included in search paths for collections and other files. For example, the initial value of [find-library-collection-paths](#%28def._%28%28quote._~23~25kernel%29._find-library-collection-paths%29%29) omits the user-specific collection directory when this parameter’s value is #f.

If -U or --no-user-path argument to racket, then [use-user-specific-search-paths](#%28def._%28%28quote._~23~25kernel%29._use-user-specific-search-paths%29%29) is initialized to #f.

> ```
(use-collection-link-paths)	→
(-> use-collection-link-paths on?)
```
(read-installation-configuration-table)	→
(-> and/c hash? immutable?)```
Returns the content of the installation’s "config.rktd" file (see [Installation Configuration and Search Paths](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=raco&rel=config-file.html&version=8.18.0.13)) as long as that content is a [hash table](hashtables.html#%28tech._hash._table%29), and otherwise returns an empty hash table.
Added in version 8.4.0.3 of package base.
------------------------------------------------------------------------


# 18.3 Interactive Help


### 18.3 Interactive Help
|                                                                                |                                                                                |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------:|
|  ([require](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29) [racket/help]()) |  package: [base](https://pkgs.racket-lang.org/package/base "Install this package using `raco pkg install base`") |
The bindings documented in this section are provided by the [racket/help]() and [racket/init](running-sa.html#%28mod-path._racket%2Finit%29) libraries, which means that they are available when the Racket executable is started with no command-line arguments. They are not provided by [racket/base](index.html) or [racket](index.html).
>
<colgroup><col style="width: 100%" /></colgroup>

syntax


# 18.3 Interactive Help

[help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29)

([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) string ...)

([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) id)

([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) id #:from module-path)

([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) #:search datum ...)

For general help, see the [main documentation page](../index.html).
The [help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) form searches the documentation and opens a web browser (using the user’s selected browser) to display the results.
> > > See [net/sendurl](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=net&rel=sendurl.html&version=8.18.0.13) for information on how the user’s browser is launched to display help information.
A simple [help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) or ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29)) form opens the main documentation page.
The ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) string [...](stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29)) form—using literal strings, as opposed to expressions that produce strings—performs a string-matching search. For example,
> ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) "web browser" "firefox")


# 18.3 Interactive Help
searches the documentation index for references that include the phrase “web browser” or “firefox.”
A ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) id) form looks for documentation specific to the current binding of id. For example,
> ```racket
> ( require net/url )
> ( help url->string )
> ```
opens a web browser to show the documentation for [url->string](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=net&rel=url.html%23%2528def._%2528%2528lib._net%252Furl..rkt%2529._url-%7E3estring%2529%2529&version=8.18.0.13) from the [net/url](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=net&rel=url.html&version=8.18.0.13) library.
For the purposes of [help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29), a [for-label](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for-label%29%29) require introduces a binding without actually executing the [net/url](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=net&rel=url.html&version=8.18.0.13) library—for cases when you want to check documentation, but cannot or do not want to run the providing module.
> ```racket
> ( require racket/gui ) ; does not work in racket
> ( require ( for-label racket/gui ) ) ; ok in racket
> ( help frame% )
> ```
If id has no for-label and normal binding, then [help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) lists all libraries that are known to export a binding for id.


# 18.3 Interactive Help
The ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) id #:from module-path) variant is similar to ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) id), but using only the exports of module-path. (The module-path module is required [for-label](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for-label%29%29) in a temporary namespace.)
> ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) [frame%](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?doc=gui&rel=frame_.html&version=8.18.0.13) #:from racket/gui) ; equivalent to the above
The ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) #:search datum [...](stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29)) form is similar to ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) string [...](stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._......%29%29)), where any non-string form of datum is converted to a string using [display](Writing.html#%28def._%28%28quote._~23~25kernel%29._display%29%29). No datum is evaluated as an expression.
For example,
> ([help](#%28form._%28%28lib._racket%2Fhelp..rkt%29._help%29%29) #:search "web browser" firefox)
also searches the documentation index for references that include the phrase “web browser” or “firefox.”
------------------------------------------------------------------------


# 18.4 Interaction Configuration


### 18.4 Interaction Configuration
|                                                                                |                                                                                |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------:|
|  ([require](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29) [racket/interaction-info]()) |  package: [base](https://pkgs.racket-lang.org/package/base "Install this package using `raco pkg install base`") |
The bindings documented in this section are provided by the [racket/interaction-info]() library, not [racket/base](index.html) or [racket](index.html).
The [racket/interaction-info]() library provides a way to register a langauge’s configuration for a [read](Reading.html#%28def._%28%28quote._~23~25kernel%29._read%29%29)-[eval](eval.html#%28def._%28%28quote._~23~25kernel%29._eval%29%29)-[print](Writing.html#%28def._%28%28quote._~23~25kernel%29._print%29%29) loop and editor.
> ```
(current-interaction-info)	→
(-> or/c #f (vector/c module-path? symbol? any/c))
(current-interaction-info info) → void?
    info	:
(-> or/c #f (vector/c module-path? symbol? any/c))


# 18.4 Interaction Configuration
```
(parameter)	→
(-> e.g., in a tool that uses racket/enter)```

Procedure variant of [enter!](#%28form._%28%28lib._racket%2Fenter..rkt%29._enter%21%29%29), where verbosity is passed along to [dynamic-rerequire](#%28def._%28%28lib._racket%2Frerequire..rkt%29._dynamic-rerequire%29%29) and re-require-enter? determines whether [dynamic-enter!](#%28def._%28%28lib._racket%2Fenter..rkt%29._dynamic-enter%21%29%29) requires racket/enter in a newly entered namespace.

Added in version 6.0.0.1 of package base.

#### 18.5.2 Loading and Reloading Modules

|                                                                                |                                                                                |
|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------:|
|  ([require](require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29) [racket/rerequire](#%28mod-path._racket%2Frerequire%29)) |  package: [base](https://pkgs.racket-lang.org/package/base "Install this package using `raco pkg install base`") |

The bindings documented in this section are provided by the [racket/rerequire](#%28mod-path._racket%2Frerequire%29) library, not [racket/base](index.html) or [racket](index.html).

> ```
(dynamic-rerequire module-path
   [ #:verbosity verbosity)    →    (listof path?)

  module-path : module-path?
  verbosity : (or/c 'all 'reload 'none) = 'reload
```


# 18.4 Interaction Configuration
(current-error-port)	→
(-> string? . → . any)```
A [parameter](eval-model.html#%28tech._parameter%29) that determines the way that trace output is displayed. The string given to proc is a trace; it does not end with a newline, but it may contain internal newlines. Each call or result is converted into a string using [pretty-print](pretty-print.html#%28def._%28%28lib._racket%2Fpretty..rkt%29._pretty-print%29%29). The parameter’s default value prints the given string followed by a newline to ([current-output-port](port-ops.html#%28def._%28%28quote._~23~25kernel%29._current-output-port%29%29)).
> ```
(parameter)	→


# 18.4 Interaction Configuration
```
(current-trace-print-args)	→
(-> symbol?
    list?
    (listof keyword?)
    list?
    number?
    void?)
(current-trace-print-args trace-print-args) → void?
    trace-print-args	:
(-> symbol?
    list?
    (listof keyword?)
    list?
    number?
    void?)```

The value of this parameter is invoked to print out the arguments of a traced call. It receives the name of the function, the function’s ordinary arguments, its keywords, the values of the keywords, and a number indicating the depth of the call.

Modifying this and [current-trace-print-results](#%28def._%28%28lib._racket%2Ftrace..rkt%29._current-trace-print-results%29%29) is useful to to get more readable or additional output when tracing syntax transformers. For example, we can use [debug-scopes](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?tag=%28mod-path._.%27debug-scopes.%27%29&version=8.18.0.13) to add scopes information to the trace, (see [debug-scopes](https://plt.cs.northwestern.edu/new-snapshots/new-snapshots/doc/local-redirect/index.html?tag=%28mod-path._.%27debug-scopes.%27%29&version=8.18.0.13) for an example), or remove source location information to just display the shape of the syntax object

In this example, we update the printers [current-trace-print-args](#%28def._%28%28lib._racket%2Ftrace..rkt%29._current-trace-print-args%29%29) and [current-trace-print-results](#%28def._%28%28lib._racket%2Ftrace..rkt%29._current-trace-print-results%29%29) by storing the current printers (ctpa and ctpr) to cast syntax objects to datum using [syntax->datum](stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-~3edatum%29%29) and then pass the transformed arguments and results to the previous printer. When tracing, syntax arguments will be displayed without source location information, shortening the output.

Examples:

> ```racket
> > ( require ( for-syntax racket/trace ) )
> > ( begin-for-syntax ( current-trace-print-args ( let ( [ ctpa ( current-trace-print-args ) ] ) ( lambda ( s l kw l2 n ) ( ctpa s ( map syntax->datum l ) kw l2 n ) ) ) ) ( current-trace-print-results ( let ( [ ctpr ( current-trace-print-results ) ] ) ( lambda ( s r n ) ( ctpr s ( map syntax->datum r ) n ) ) ) ) )
> > ( trace-define-syntax fact ( syntax-rules ( ) [ ( _ x ) 120 ] ) )
> > ( fact 5 )
> >(fact '(fact 5)) <120> 120
> ```

We must take care when modifying these parameters, especially when the transformation makes assumptions about or changes the type of the argument/result of the traced identifier. This modification of [current-trace-print-args](#%28def._%28%28lib._racket%2Ftrace..rkt%29._current-trace-print-args%29%29) and [current-trace-print-results](#%28def._%28%28lib._racket%2Ftrace..rkt%29._current-trace-print-results%29%29) is an imperative update, and will affect all traced identifiers. This example assumes all arguments and results to all traced functions will be syntax objects, which is the case only if you are only tracing syntax transformers. If used as-is, the above code could result in type errors when tracing both functions and syntax transformers. It would be better to use [syntax->datum](stxops.html#%28def._%28%28quote._~23~25kernel%29._syntax-~3edatum%29%29) only when the argument or result is actually a syntax object, for example, by defining maybe-syntax->datum as follows.

Examples:

> ```racket
> > ( require ( for-syntax racket/trace ) )
> > ( begin-for-syntax ( define ( maybe-syntax->datum syn? ) ( if ( syntax? syn? ) ( syntax->datum syn? ) syn? ) ) ( current-trace-print-args ( let ( [ ctpa ( current-trace-print-args ) ] ) ( lambda ( s l kw l2 n ) ( ctpa s ( map maybe-syntax->datum l ) kw l2 n ) ) ) ) ( current-trace-print-results ( let ( [ ctpr ( current-trace-print-results ) ] ) ( lambda ( s l n ) ( ctpr s ( map maybe-syntax->datum l ) n ) ) ) ) ( trace-define ( precompute-fact syn n ) ( datum->syntax syn ( apply * ( build-list n add1 ) ) ) ) )
> > ( trace-define ( run-time-fact n ) ( apply * ( build-list n add1 ) ) )
> > ( require ( for-syntax syntax/parse ) )
> > ( trace-define-syntax ( fact syn ) ( syntax-parse syn [ ( _ x:nat ) ( precompute-fact syn ( syntax->datum #' x ) ) ] [ ( _ x ) #' ( run-time-fact x ) ] ) )
> > ( fact 5 )
> >(fact '(fact 5)) >(precompute-fact '(fact 5) 5) <120> 120
> > ( fact ( + 2 3 ) )
> >(fact '(fact (+ 2 3))) <'(run-time-fact (+ 2 3))>(run-time-fact 5) <120> 120
> ```

> ```
(current-trace-print-results)	→
(-> symbol?
    list?
    number?
    any)
(current-trace-print-results trace-print-results) → void?
    trace-print-results	:
(-> symbol?
    list?
    number?
    any)
```


# 18.4 Interaction Configuration
(current-prefix-in)	→
(-> current-prefix-in prefix)
(current-prefix-in prefix) → void?
    prefix	:
(-> current-prefix-in prefix)```
This string is used by the default value of [current-trace-print-args](#%28def._%28%28lib._racket%2Ftrace..rkt%29._current-trace-print-args%29%29) indicating that the current line is showing the a call to a traced function.
It defaults to ">".
> ```
(current-prefix-out)	→
(-> current-prefix-out prefix)
(current-prefix-out prefix) → void?
    prefix	:
(-> current-prefix-out prefix)
```
(E)	→```
(struct)	→
(-> if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._~3d~3e%29%29)
```
------------------------------------------------------------------------