-
Notifications
You must be signed in to change notification settings - Fork 144
Deparsing API #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
This was referenced Oct 1, 2018
Maybe And maybe |
lionel-
added a commit
that referenced
this issue
Oct 8, 2018
Use label() to create default names. Currently unexported. Part of #636
Squash quosures with the label variant but represent them with |
Merged
lionel-
added a commit
to lionel-/rlang
that referenced
this issue
Dec 21, 2018
Should be used instead of `quo_name()` Part of r-lib#636
lionel-
added a commit
to lionel-/rlang
that referenced
this issue
Jan 3, 2019
Should be used instead of `quo_name()` Part of r-lib#636
Closed
I was searching for Is it safe to use |
If you need a multi-line deparser yes. It'll go through a long lifecycle of deprecation. |
4 tasks
Discussion continues in #1173. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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
_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.The text was updated successfully, but these errors were encountered: