Skip to content

Conversation

bashbunni
Copy link
Contributor

@bashbunni bashbunni commented Jan 10, 2025

This allows users to modify existing Trees. In the current version of this table, there is no way to change existing children outside of adding a new child with Tree.Child().

This also handles operations on Leaf types to turn them into Trees.

See examples for usage on these changes. Those examples are testable, so see their output in comment to see how these API changes work.

Related: #452

@bashbunni bashbunni added the enhancement New feature or request label Jan 10, 2025
This was referenced Jan 10, 2025
}
case Node:
nodes = append(nodes, item)
case fmt.Stringer:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be useful to support encoding.TextMarshaler as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have this in other type checks in tree, maybe something we can add down the line

@bashbunni bashbunni added this to the tree milestone Jan 23, 2025
@bashbunni
Copy link
Contributor Author

Need to look at the feedback from #452 more closely

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

Successfully merging this pull request may close these issues.

2 participants