git @ Cat's Eye Technologies Robin / master stdlib / list-p.robin
master

Tree @master (Download .tar.gz)

list-p.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
-->

### `list?` ###

    -> Tests for functionality "Evaluate Robin Expression (with literal)"

`list?` evaluates its argument, then evaluates to `#t` if it is a list,
`#f` otherwise.

    | (list? (literal (a b)))
    = #t

    | (list? (literal (a b c d e f)))
    = #t

    | (list? (prepend 4 (prepend 5 ())))
    = #t

The empty list is a list.

    | (list? ())
    = #t

Symbols are not lists.

    | (list? (literal a))
    = #f

The argument to `list?` may (naturally) be any type, but there must be
exactly one argument.

    | (list? (prepend 4 ()) (prepend 6 ()))
    ? abort (illegal-arguments ((prepend 4 ()) (prepend 6 ())))

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

'<<SPEC'

(require list?)