-
Notifications
You must be signed in to change notification settings - Fork 144
Description
Meta-issue about the deparsing API:
Naming
-
I'm not sure why we duplicated the API with
expr_
andquo_
functions. Isn't it simpler to just treat quosures as any other language type and deal with them inexpr_
functions as well? -
Perhaps relevant for naming: These functions are about pretty printing, while
expr_deparse()
is about transferring R objects as text. Though the latter also has pretty printing features such as omitting the last n elements of vectors. -
The naming of
expr_text()
,expr_name()
etc generally suggests they are accessors. In reality they are actions (deparse variants). -
Are
expr_name()
andquo_name()
misnomers? It seems it should only be used to provide default names for quoted arguments that might be complex expressions. I often see it used for transforming symbols to strings, which should better be done withas_string()
oras.character()
(the former works better on Windows with foreign characters).Perhaps
expr_pretty_name()
would be more suggestive that it's about default names?
Features
- Do we need a
_line()
variant? We are using_name()
for backtraces, it seems we are really after line. It should try to deparse as much of an expression as possible while keeping it on a same line and withinpeek_option("width")
. It should take a column position as argument to be substracted from width.