op-null-default: Default value for 'NULL'

op-null-defaultR Documentation

Default value for 'NULL'

Description

This infix function makes it easy to replace 'NULL's with a default value. It's inspired by the way that Ruby's or operation ('||') works.

Usage

x %||% y

Arguments

x, y

If 'x' is NULL, will return 'y'; otherwise returns 'x'.

Examples

1 %||% 2
NULL %||% 2


pteetor/tutils documentation built on April 25, 2024, 9:14 a.m.