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:
> (undefined? #f) #f
> (undefined? (void)) #f
> (undefined? undefined) #t
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
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
Examples:
syntax
(:= expr ...)
A convenient alias for define.
syntax
(=! expr ...)
A convenient alias for set!.