Skip to content

Check if two expressions are equivalent

Source code

Description

Indicate if this expression is the same as another expression. See also the counterpart $meta$neq().

Usage

<Expr>$meta$eq(other)

Arguments

other Expr to compare with

Value

A logical value

Examples

library("polars")

# three naive expression literals
e1 = pl$lit(40) + 2
e2 = pl$lit(42)
e3 = pl$lit(40) + 2

# e1 and e3 are identical expressions
e1$meta$eq(e3)
#> [1] TRUE
# when evaluated, e1 and e2 are equal
e1$eq(e2)$to_r()
#> [1] TRUE
# however, on the meta-level, e1 and e2 are NOT identical expressions
e1$meta$eq(e2)
#> [1] FALSE