-
Notifications
You must be signed in to change notification settings - Fork 10
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
mk_function: more than 1 dispatch? #6
Comments
Oh, realized I can just make the dispatches in a function over the returned made functions. |
Oh, you've said a ptoblem. In fact, theoretically we can re-implement the multiple dispatch in the GG's system: struct RuntimeMethod{TypeVars, Args, Kwargs, Body} end
struct RuntimeFunction{Methods} end We can hold a list of methods in And when we call a
It must be correct! However too complex... |
https://github.com/JuliaDiffEq/ModelingToolkit.jl/pull/173/files#diff-7849540f758d65e684b2dcd2d863bbfcR223-R226 this shows the workaround, where the two returned functions are the |
When you're making functions you can decide how to make them based on your environment(arguments, local variables, global state, etc.), but multiple dispatch is not allowed on an (already) made function :-) |
Oh, please DO NOT use GG in the development! It's still WIP. It needs several days to wait for the registrations of its dependencies and register itself! |
It's just a PR. There's no intent to merge until GG registers (#7) |
Okay. I've checked your PR and found you didn't make nested closures in the function to make, that's great because it's an already solved case in GG. But I still wonder if it's possible for ModelingToolkit to generate functions with nested closures? |
The functions that it's building are quite simple, so that shouldn't be an issue. |
Nice, good to know this. |
Is there a way to have this make more than 1 dispatch for a function?
The text was updated successfully, but these errors were encountered: