Create a function that that always returns a specific object.

Description

Always(.x) is a closure function that takes any object .x, and returns a function that always returns object .x.

Usage

1
Always(.x)

Arguments

.x

An object.

Value

A function that itself returns .x.

Examples

1
2
3
4
5
# comment here
always_0 <- Always(0)
always_0() # 0
always_true <- Always(TRUE)
always_true() # TRUE