Skip to content
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

Make accessing and mutating parent part of the API #19

Open
rofinn opened this issue Jul 31, 2019 · 4 comments
Open

Make accessing and mutating parent part of the API #19

rofinn opened this issue Jul 31, 2019 · 4 comments

Comments

@rofinn
Copy link

rofinn commented Jul 31, 2019

It'd be nice if there was a common API for accessing and mutating parent data for wrapper array types.

@ChrisRackauckas
Copy link
Member

Yes, that is a very good idea.

iswrapped(A)
getparent(A)

?

@ChrisRackauckas
Copy link
Member

should getparent also be applied to wrapped number types, like Dual numbers and TrackedReal?

@rofinn
Copy link
Author

rofinn commented Jul 31, 2019

Yeah, I think that would make sense... assuming they're using the existing type hierarchy (e.g., TrackedReal <: Real).

@Tokazama
Copy link
Member

We have parent_type now. You can do parent_type(T) <: T to confirm that T isn't a wrapper. Does that resolve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants