Skip to main content

r_def_name

Function r_def_name 

Source
pub(crate) fn r_def_name(name: &str) -> String
Expand description

The left-hand side of a generated <name> <- function(...) definition.

Syntactic names pass through unchanged so the common output stays readable; a non-syntactic one (an S3 method on [, $, ==, …) is wrapped in backticks, which R accepts for any name. Without this the wrapper file did not parse (#1475).

R processes backslash escapes inside backticks as it does in strings, so a \ is doubled (first, so the escapes added for backticks stay single) and a backtick becomes \`: the name a\b is written `a\\b`. miniextendr-api’s duplicate-definition scan (registry::parse_top_level_fn_def_name) reads this escaped spelling.