View Source Document

head.robin

;'<<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
-->

### `head` ###

    -> Tests for functionality "Evaluate core Robin Expression"

`head` evaluates its argument to a list, and evaluates to the first element
of that list.

    | (head (prepend #t ()))
    = #t

`head` expects its argument to be a list.

    | (head #f)
    ? abort (expected-list #f)

`head` expects exactly one argument.

    | (head (prepend #t ()) (prepend #f ()))
    ? abort (illegal-arguments ((prepend #t ()) (prepend #f ())))

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

`head` is basically equivalent to Scheme's `car`.

'<<SPEC'

(require head)