coalesce
Function
coalesce — return first value that is not null, a "missing" error, or a "quiet" error
Synopsis
coalesce(val: any [, ... val: any]) -> bool
Description
The coalesce function returns the first of its arguments that is not null,
error("missing")
, or error("quiet")
. It returns null if all its arguments
are null, error("missing")
, or error("quiet")
.
Examples
super -z -c 'yield coalesce(null, error("missing"), error("quiet"), 1)'
=>
1
super -z -c 'yield coalesce(null, error("missing"), error("quiet"))'
=>
null