git @ Cat's Eye Technologies Robin / develop-0.7 stdlib / macro-p.robin
develop-0.7

Tree @develop-0.7 (Download .tar.gz)

macro-p.robin @develop-0.7raw · history · blame

;'<<SPEC'

### `macro?` ###

    -> Tests for functionality "Evaluate core Robin Expression"

`macro?` evaluates its argument, then evaluates to `#t` if it is a macro,
or `#f` if it is not.

    | (macro? (macro (self args env) args))
    = #t

Intrinsic macros are macros.

    | (macro? macro)
    = #t

Literal symbols are not macros, even if they're the name of one.

    | (macro? ((macro (self args env) (head args)) macro))
    = #f

Numbers are not macros.

    | (macro? 5)
    = #f

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

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

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

'<<SPEC'

(require macro?)