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

Tree @master (Download .tar.gz)

not.robin @masterraw · history · blame

;'<<SPEC'

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

`not` evaluates its single argument to a boolean, then evaluates to
the logical negation of that boolean.

    | (not #t)
    = #f

    | (not #f)
    = #t

`not` expects exactly one argument.

    | (not)
    ? abort (illegal-arguments

    | (not #t #f)
    ? abort (illegal-arguments

`not` expects its single argument to be a boolean.

    | (not 33)
    ? abort (expected-boolean 33)

'<<SPEC'

(define not (fun (a)
  (if a #f #t)))