-
Notifications
You must be signed in to change notification settings - Fork 37
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
Extending a class from another package #317
Comments
Could we detect when this is happening, just by comparing the namespace/package of the two classes, and perform some sort of lazy updating behind the scenes? There would then be no need for something like |
We could also use the Regardless, we may still need some optional additional way of lazily registering classes in case you want to extend a class from a suggested package or for #250. But hopefully we can reserve |
I think the easiest way to start prototyping this is to allow Ways in which the
|
I think we want this to be purely dynamic; another option would be to somehow replace a static class definition at package load time but I think that would require either walking over every object in the package environment or replacing the parent class definition with a reference type where we could modify in one place. |
Ways that a parent class might change (to help me think about the problem): How could a parent class change?
|
Looking at this and the sections around it might be useful:
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node300.html
Best,
luke
…On Thu, 14 Sep 2023, Hadley Wickham wrote:
Ways that a parent class might change (to help me think about the problem):
How could a parent class change?
* It could add a new property:
* It could remove a property
* It could make a property more permissive
* It could make a property more restrictive
* It could change the property class
* It could change the property default
* It could change its constructor
* It could make the validator more strict
* It could make the validator more permissive
* It could change its parent
* It could change its name/package
* It could change its abstract status
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to thisthread.[AA55UVCC2LUN4HBWDLOL7DLX2L7LBA5CNFSM6AAAAAA2P2IBYCWGG33NNVSW45C7OR4
XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTGPRVYM.gif] Message ID:
***@***.***>
--
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa Phone: 319-335-3386
Department of Statistics and Fax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: ***@***.***
Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu
--8323329-1224346090-1694697897=:4304--
|
Currently if you extend a class from another package, the parent class will be captured at build-time. So if that package is later updated, and your package is not re-built, it's possible for two inconsistent versions of a class to exist. (The methods will be fine since they're already registered dynamically if needed, but the properties and validator might not).
We might be able to fix this and #250 at the same time by creating something like
new_external_class()
which contains just enough information to perform minimal static checks with the actual invocation always happening at run time. This will require some careful thought and analysis.The text was updated successfully, but these errors were encountered: