grapes-and-and-grapes: NULL-coalescing-like operator

%&&%R Documentation

NULL-coalescing-like operator

Description

If the left-hand side is not NULL, returns the right-hand side. Otherwise, returns NULL. This is useful for guarding expressions that should only be executed if a value is not NULL. Meant to be similar to the ⁠%||%⁠ operator (which returns y if x is NULL).

Usage

x %&&% y

Arguments

x

The object to check for NULL.

y

The value to return if x is not NULL.

Value

NULL or the value of y.


stbl documentation built on Nov. 5, 2025, 6:02 p.m.