Skip to content

Commit

Permalink
Update Coalton documentation for coalton-lang/coalton@60d3e81
Browse files Browse the repository at this point in the history
  • Loading branch information
coalton-docs-bot authored and stylewarning committed Oct 15, 2024
1 parent 7a49836 commit 3af5517
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions content/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -7020,7 +7020,7 @@ Return true if the first argument appears as a substring within the second argum

### Types

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L136-L137">LISPCONDITION</a></code> <sup><sub>[TYPE]</sub></sup><a name="lispcondition-type"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L143-L144">LISPCONDITION</a></code> <sup><sub>[TYPE]</sub></sup><a name="lispcondition-type"></a>

Condition for lisp error handling. Uses `cl:condition`.

Expand All @@ -7038,7 +7038,7 @@ Condition for lisp error handling. Uses `cl:condition`.

### Structs

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L97-L107">PROFILE :A</a></code> <sup><sub>[STRUCT]</sub></sup><a name="profile-type"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L104-L114">PROFILE :A</a></code> <sup><sub>[STRUCT]</sub></sup><a name="profile-type"></a>
- <code>OUTPUT :: :A</code><br/>The output of the function
- <code>RUN-TIME :: COALTON:UFIX</code><br/>The run time of the run
- <code>REAL-TIME :: COALTON:UFIX</code><br/>The real time of the run
Expand All @@ -7059,7 +7059,7 @@ A profile of a run function.

### Values

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L206-L212">(ADD-FEATURE FEAT)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="add-feature-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L213-L219">(ADD-FEATURE FEAT)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="add-feature-value"></a>
<code>(<a href="#string-type"><code>STRING</code></a> &rarr; <a href="#unit-type"><code>UNIT</code></a>)</code>

Adds a feature `feat` to `cl:*features*`.
Expand All @@ -7068,7 +7068,7 @@ Adds a feature `feat` to `cl:*features*`.

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L170-L173">(ARCHITECTURE _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="architecture-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L177-L180">(ARCHITECTURE _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="architecture-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#string-type"><code>STRING</code></a>)</code>

The system's architecture (stored at compile time).
Expand All @@ -7077,7 +7077,7 @@ The system's architecture (stored at compile time).

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L225-L231">(ARGV0 _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="argv0-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L232-L238">(ARGV0 _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="argv0-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; (<a href="#optional-type"><code>OPTIONAL</code></a> <a href="#string-type"><code>STRING</code></a>))</code>

The first command line argument (stored at compile time).
Expand All @@ -7086,7 +7086,7 @@ The first command line argument (stored at compile time).

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L110-L127">(CAPTURE-PROFILE F)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="capture-profile-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L117-L134">(CAPTURE-PROFILE F)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="capture-profile-value"></a>
<code>&forall; :A. ((<a href="#unit-type"><code>UNIT</code></a> &rarr; :A) &rarr; (<a href="#profile-type"><code>PROFILE</code></a> :A))</code>

Runs a function, recording profile information and returning a Profile object.
Expand All @@ -7095,7 +7095,7 @@ Runs a function, recording profile information and returning a Profile object.

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L219-L222">(CMD-ARGS _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="cmd-args-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L226-L229">(CMD-ARGS _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="cmd-args-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; (<a href="#list-type"><code>LIST</code></a> <a href="#string-type"><code>STRING</code></a>))</code>

The current command line arguments (stored at compile time).
Expand All @@ -7104,7 +7104,7 @@ The current command line arguments (stored at compile time).

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L200-L203">(FEATURES _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="features-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L207-L210">(FEATURES _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="features-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; (<a href="#list-type"><code>LIST</code></a> <a href="#string-type"><code>STRING</code></a>))</code>

Returns a list of active features, from `cl:*features*`.
Expand All @@ -7113,7 +7113,7 @@ Returns a list of active features, from `cl:*features*`.

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L43-L47">(GC _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="gc-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L45-L49">(GC _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="gc-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#unit-type"><code>UNIT</code></a>)</code>

Perform a full garbage collection.
Expand All @@ -7122,7 +7122,7 @@ Perform a full garbage collection.

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L92-L95">(GET-BYTES-CONSED _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="get-bytes-consed-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L99-L102">(GET-BYTES-CONSED _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="get-bytes-consed-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#ufix-type"><code>UFIX</code></a>)</code>

Gets the number of bytes consed (only implemented for SBCL
Expand All @@ -7131,7 +7131,7 @@ Gets the number of bytes consed (only implemented for SBCL

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L84-L87">(GET-REAL-TIME _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="get-real-time-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L91-L94">(GET-REAL-TIME _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="get-real-time-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#ufix-type"><code>UFIX</code></a>)</code>

Gets the real-time.
Expand All @@ -7140,7 +7140,7 @@ Gets the real-time.

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L78-L81">(GET-RUN-TIME _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="get-run-time-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L85-L88">(GET-RUN-TIME _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="get-run-time-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#ufix-type"><code>UFIX</code></a>)</code>

Gets the run-time.
Expand All @@ -7149,7 +7149,7 @@ Gets the run-time.

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L149-L155">(GETENV VAR)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="getenv-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L156-L162">(GETENV VAR)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="getenv-value"></a>
<code>(<a href="#string-type"><code>STRING</code></a> &rarr; (<a href="#optional-type"><code>OPTIONAL</code></a> <a href="#string-type"><code>STRING</code></a>))</code>

Gets the value of the environmental variable `var`, errors if `var` doesn't exist.
Expand All @@ -7158,7 +7158,7 @@ Gets the value of the environmental variable `var`, errors if `var` doesn't exis

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L182-L185">(HOSTNAME _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="hostname-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L189-L192">(HOSTNAME _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="hostname-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#string-type"><code>STRING</code></a>)</code>

Returns the system's hostname. This is a function because the hostname can be redefined.
Expand All @@ -7167,7 +7167,7 @@ Returns the system's hostname. This is a function because the hostname can be re

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L188-L191">(IMPLEMENTATION _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="implementation-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L195-L198">(IMPLEMENTATION _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="implementation-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#string-type"><code>STRING</code></a>)</code>

The lisp implementation (stored at compile time).
Expand All @@ -7176,7 +7176,7 @@ The lisp implementation (stored at compile time).

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L194-L197">(LISP-VERSION _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="lisp-version-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L201-L204">(LISP-VERSION _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="lisp-version-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#string-type"><code>STRING</code></a>)</code>

The lisp implementation version (stored at compile time).
Expand All @@ -7185,7 +7185,7 @@ The lisp implementation version (stored at compile time).

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L176-L179">(OS _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="os-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L183-L186">(OS _)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="os-value"></a>
<code>(<a href="#unit-type"><code>UNIT</code></a> &rarr; <a href="#string-type"><code>STRING</code></a>)</code>

The system's operating system (stored at compile time).
Expand All @@ -7194,7 +7194,7 @@ The system's operating system (stored at compile time).

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L159-L163">(SETENV! VAR VAL)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="setenv!-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L166-L170">(SETENV! VAR VAL)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="setenv!-value"></a>
<code>(<a href="#string-type"><code>STRING</code></a> &rarr; <a href="#string-type"><code>STRING</code></a> &rarr; <a href="#unit-type"><code>UNIT</code></a>)</code>

Sets an environment variable `var` to string `val`, only if `var` already exists.
Expand All @@ -7203,16 +7203,18 @@ Sets an environment variable `var` to string `val`, only if `var` already exists

***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L65-L69">(SLEEP N)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="sleep-value"></a>
<code>(<a href="#integer-type"><code>INTEGER</code></a> &rarr; <a href="#unit-type"><code>UNIT</code></a>)</code>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L67-L76">(SLEEP N)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="sleep-value"></a>
<code>&forall; :A. <a href="#rational-class">RATIONAL</a> :A &rArr; (:A &rarr; <a href="#unit-type"><code>UNIT</code></a>)</code>

Sleep for `n` seconds.
Sleep for `n` seconds, where `n` can be of any type with an instance of `Rational`.

Sleep uses type class `Rational`'s `best-approx` instead of `Real`'s `real-approx` because it handles the approximation without arbitrary precision. The only `Real` type excluded by this decision is `CReal`.



***

#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L50-L62">(TIME F)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="time-value"></a>
#### <code><a href="https://github.com/coalton-lang/coalton/tree/main/library/system.lisp#L52-L64">(TIME F)</a></code> <sup><sub>[FUNCTION]</sub></sup><a name="time-value"></a>
<code>&forall; :A. ((<a href="#unit-type"><code>UNIT</code></a> &rarr; :A) &rarr; (<a href="#tuple-type"><code>TUPLE</code></a> :A <a href="#integer-type"><code>INTEGER</code></a>))</code>

Run the thunk `f` and return a tuple containing its value along with the run time in microseconds.
Expand Down

0 comments on commit 3af5517

Please sign in to comment.