nseval (version 0.4)

forced: Forcing and forcedness of arguments and quotations.

Description

There are two kinds of quotations: forced and unforced. Unforced quotations have an expression and an environment; forced quotations have an expression and a value.

forced(q) tests whether a quotation is forced.

forced(d) on a dots object tests whether each element is forced, and returns a logical vector.

forced_quo(x) forces its argument and then captures it. argument literally.

forced_quo_(x) makes a forced quotation from any data. Specifically it constructs a quotation with the same object in both the expr and value slots, except if is a language object in which case the value is wrapped in quote().

forced_dots(...) forces its arguments and emits a dots object.

force_(x) converts an unforced quotation or dots object into a forced one, by evaluating it.

value or values returns the value of a quotation or dots, forcing it if necessary.

Usage

forced(x)

# S3 method for quotation forced(x, ...)

# S3 method for dots forced(x)

# S3 method for default forced(x)

forced_quo(x)

forced_quo_(x)

forced_dots(...)

force_(x, ...)

# S3 method for quotation force_(x, eval = base::eval, ...)

# S3 method for dots force_(x, ...)

value(x, ...)

# S3 method for quotation value(x, mode = "any", ...)

# S3 method for dots value(x, ...)

values(x)

# S3 method for dots values(x)

Arguments

x

A quotation or dots object.

...

any number of arguments; they will be quoted literally.

eval

Which evaluation function to use.

mode

Whether to force in "any" mode or "function" mode (see locate).

Value

forced(x) returns a logical.

forced_quo and forced_quo_ return quotation objects.

forced_dots and forced_dots_ return dots objects.

value(x) returns the result of forcing the quotation.

values returns a list.

See Also

is_forced

force