Basic support to mimick the use of interface classes #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Winston,
I kindly ask you to consider accepting this pull request. It is associated with my addition to #9 yesterday.
I figured that I actually don't really need multiple inheritance but just a way to distinguish between
xy
is implementend in$new()
would really kind of suffice.I'm aware that I might be pushing
R6
's intended use and R's class inheritance mechanism a bit, but I personally like the SOLID principles in general and that of interfaces in particular very much. I think following those simply makes for better code and IMO even "just" prototyping OO stuff in R with R6 shoudn't be an exception.This is my first substantial pull request for another person's codebase. I tried to be both stick to your style and be thorough (updated doc and unit tests), but probably something still slipped through the cracks ;-) So please don't hesitate to contact me in case there's something else that I can do!
Note:
I noticed that my modification of the
print
method is a bit of in cases whereget(class(x)[1])
fails ingetImplementClassname
(scriptR/interface_utils.R
). It worked upon manual execution oftest_that()
, but not when the file was sourced.