klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
862 stars 48 forks source link

Introduce operator alias for `identical` #303

Closed klmr closed 1 year ago

klmr commented 1 year ago

Calls to identical() litter the ‘box’ code base (> 40 uses) because == isn’t sufficiently robust.

Replace it by an operator (e.g. %==%) to improve code readability. Compare:

if (identical(declaration, quote(expr =)) && identical(alias, '')) return()
if (declaration %==% quote(expr =) && alias %==% '') return()