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

Simple method forwarding example #42

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

smartalecH
Copy link
Contributor

@smartalecH smartalecH commented Jan 23, 2023

Following a discussion on discourse, I created a simple example where I create a new Material type that is a subtype of Shape and can then be used to store metadata (like material parameters) without redefining any of the core GeometryPrimitives methods (instead we just "forward" them).

Unfortunately, this produces a stack overflow error. Typically, stack overflow errors are caused by recursion. But I'm using the findfirst() method (not on a recursive KDtree). So I'm not sure where the recursion would take place. So it's probably something else. Unfortunately there's no stack trace, and my debugger dies.

(It would also be good to include all of the important interface functions up front. For example, It's obvious from src/GeometryPrimitives.jl that Base.in() needs to be forwarded, but it's not obvious that bounds() also needs to be forwarded (based on the logic in the new findfirst() method).

(This PR is stacked on top of #39... all of the extra changes here will go away once I can rebase).

@smartalecH smartalecH changed the title Simple forward examples Simple method forwarding example Jan 23, 2023
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

Successfully merging this pull request may close these issues.

1 participant