-
-
Notifications
You must be signed in to change notification settings - Fork 8
Creates special case for '=' processing #253
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
base: main
Are you sure you want to change the base?
Conversation
Unit Tests Summary 1 files 12 suites 3s ⏱️ Results for commit b46feff. ♻️ This comment has been updated with latest results. |
Unit Test Performance DifferenceAdditional test case details
Results for commit 4731e87 ♻️ This comment has been updated with latest results. |
Code Coverage Summary
Diff against main
Results for commit: b46feff Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Reduce(function(u, v) { | ||
if (inherits(v, "=") && identical(typeof(v), "language")) { | ||
class(v) <- unique(c("language", class(v))) | ||
} | ||
eval_code(u, v) | ||
}, init = object, x = code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@averissimo what's going on : D ?
Does it mean that =
has some special class attribute that is non-uniuqe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a very weird situation where typeof(v)
is language
(same as <-
and others, but it doesn't dispatch on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, thanks!
testthat::it("single expression", { | ||
q <- qenv() | ||
q <- within(q, { | ||
i <- 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@averissimo test cays that run with =
. Should we use =
in the test?
i <- 1 | |
i = 1 |
j <- 2 | ||
i <- 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@averissimo test claims multiple expressions
. Do you mean multiple assignemnts, or just more than one assignmnent at atll?
j <- 2 | |
i <- 1 | |
j <- 2 | |
i = 1 |
Reduce(eval_code, init = object, x = code) | ||
Reduce(function(u, v) { | ||
if (inherits(v, "=") && identical(typeof(v), "language")) { | ||
class(v) <- unique(c("language", class(v))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class(v) <- unique(c("language", class(v))) | |
# typeof(`=`) is language, but it doesn't dispatch on it, so we need to explicitly pass it as first class of the object | |
class(v) <- unique(c("language", class(v))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@averissimo I left you 3 comments/suggestions. Other than that this is good to be merged
Pull Request
=
assigment fails withwithin
curly-expression #252Changes description
=
as it is not recognizes aslanguage
in S4 dispatchNote to reviewers
the code with
=
call has a language type, but it tales priority somewhere on the dispatcher and tries to dispatch with this class (->
doesn't have a problem)