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

infix documentation built on May 1, 2019, 7:32 p.m.

Related to nil in infix...