Skip to contents

Counts only the leaves — literals and variables — exactly as v1's eml_K() did. Provided for backwards compatibility; the paper's K is total node count, so prefer eml_K() in new code.

Usage

eml_leafcount(expr)

Arguments

expr

an EML expression.

Value

Integer scalar.

See also

eml_K() for the paper's total node count.

Other eml_inspectors: eml_K(), eml_depth(), eml_rpn()

Examples

eml_leafcount(quote(eml(1, eml(eml(1, x), 1)))) # 4 (v1 behaviour)
#> [1] 4