nil: Default value for 'NULL'

Description Usage Arguments Examples

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

1
a %||% b

Arguments

a, b

If a is NULL, will return b; otherwise returns a.

Examples

1
2
1 %||% 2 # returns 1
NULL %||% 2 # returns 2

ebeneditos/infix documentation built on Jan. 18, 2020, 10:37 p.m.