-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
127 introduce within.qenv
#147
Conversation
Code Coverage Summary
Diff against main
Results for commit: 260ae9f Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Since we want to store code as is, it becomes an issue to perform substitution properly. Code coming in (whether it's through |
A solution has been proposed 👍 |
Closes #127
Added an S3
within
method for classqenv
.Usage:
within(data, expr, code, ...)
.data
isqenv
, this is handled by S3 dispatchexpr
is for literal codecode
is for variables holding code (call, list of calls, expression, list of expressions) or literal character stringsCode passed in any form is converted into list of (single) calls, which are evaluated sequentially.
The whole code is appended to the
@code
slot. Currently this is stored asexpression
but following #146 the slot will hold a single string, which will enable keeping comments.Characters (vectors or strings) passed to
code
are stored as single strings, combined withpaste(..., collapse = "\n")
.Language (calls or lists of calls, expressions or lists of expressions) passed to
code
are deparsed and combined likewise.