git @ Cat's Eye Technologies Robin / master stdlib / abort.robin
master

Tree @master (Download .tar.gz)

abort.robin @masterraw · history · blame

;'<<SPEC'

<!--
Copyright (c) 2012-2024, Chris Pressey, Cat's Eye Technologies.
This file is distributed under a 2-clause BSD license.  See LICENSES/ dir.
SPDX-License-Identifier: LicenseRef-BSD-2-Clause-X-Robin
-->

### `abort` ###

    -> Tests for functionality "Evaluate core Robin Expression"

`abort` evaluates its argument to obtain a value _x_, then produces
an abort value with _x_ as its payload.

See the Robin specification for the expected behaviour of abort values.

For the sake of usability, the abort should include a message which
refers to the condition that triggered it, but this is not a strict
requirement.

    | (abort 999999)
    ? abort 999999

`abort`'s single argument may be any kind of value, but `abort` expects
exactly one argument.

    | (abort)
    ? abort (illegal-arguments ())

    | (abort 2 3 4)
    ? abort (illegal-arguments (2 3 4))

'<<SPEC'

(require abort)