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

Avoid or clarify possible pun on Base.parent #80

Open
goretkin opened this issue Apr 26, 2021 · 1 comment
Open

Avoid or clarify possible pun on Base.parent #80

goretkin opened this issue Apr 26, 2021 · 1 comment

Comments

@goretkin
Copy link

Base.parent(root::BinaryNode, node::BinaryNode) = isdefined(node, :parent) ? node.parent : nothing

The definition doesn't seem to be used, and I'm not sure what it illustrates. In any case, this seems to be a pun on Base.parent:

help?> parent
[...]
  parent(A)

  Return the underlying "parent array”. This parent array of objects of types SubArray, ReshapedArray or LinearAlgebra.Transpose is what was passed as an argument to view, reshape,
  transpose, etc. during object creation. If the input is not a wrapped object, return the input itself.
@jlumpe
Copy link
Collaborator

jlumpe commented Apr 27, 2021

The parent API hasn't really been strictly defined yet, so I agree that Base.parent shouldn't be used for getting the parent of a node. I plan to submit a PR for that sometime in the near future in which it's a separate function.

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

2 participants