On this page:
undefined?
orf
any?
andf
all?
none?
:  =
=!

1 Logical Relations🔗ℹ

 (require relation/logic) package: relation-lib

Logical primitives and predicates.

procedure

(undefined? v ...)  any/c

  v : any/c
A predicate to check whether a value is eq? to undefined. The value undefined could be used as a placeholder default value for a function argument, in lieu of the Lisp convention of using #f, especially in cases where #f could be a legitimate value for the argument, precluding its use as a placeholder.

Examples:

procedure

(orf v ...)  any/c

  v : any/c

procedure

(any? vs)  any/c

  vs : sequence?
Similar to or but a function rather than a macro, so that it can be used in functional combinators such as fold. any? is a predicate to check if any of a sequence of values are truthy, equivalent to (apply orf vs).

Examples:
> (orf #f #t #t)

#t

> (orf #f #f #f)

#f

> (orf 1 2 3)

1

> (any? '(#f #t #t))

#t

> (any? '(#f #f #f))

#f

> (any? '(1 2 3))

1

procedure

(andf v ...)  any/c

  v : any/c

procedure

(all? vs)  any/c

  vs : sequence?
Similar to and but a function rather than a macro, so that it can be used in functional combinators such as fold. all? is a predicate to check if all of a sequence of values are truthy, equivalent to (apply andf vs).

Examples:
> (andf #f #t #t)

#f

> (andf #t #t #t)

#t

> (andf 1 2 3)

3

> (all? '(#f #t #t))

#f

> (all? '(#t #t #t))

#t

> (all? '(1 2 3))

3

procedure

(none? v)  any/c

  v : sequence?
Equivalent to (compose not any?), a predicate to check if none of the inputs are truthy.

Examples:
> (none? '(#f #t #t))

#f

> (none? '(#f #f #f))

#t

> (none? '(1 2 3))

#f

syntax

(:= expr ...)

A convenient alias for define.

syntax

(=! expr ...)

A convenient alias for set!.