PROOF OF CONCEPT: a function to write extension functions with warning#106
PROOF OF CONCEPT: a function to write extension functions with warning#106
Conversation
|
I did something similar here: https://github.com/WIAS-PDELib/ExtendableGrids.jl/tree/jpt/extension-error-proof-of-concept May be this is even sufficient. Let us see what the others say. |
|
I have now fiddled around with custom errors. |
|
Mid term the plan would be to put this in its own package since it's useful in many places.
|
|
@pjaap @j-fu I have now figured out how to do multiple arguments as well but would have restructure a lot to test it here as well. But I have tested it in a small separate file. I have also build this small macro: Then, calling |
Do not get your hands too dirty with macros 😉 Does this work if the extension function is type-annotated? |
The function in the extension actually has to be annotated otherwise you get a precompile error about overwriting the function in the extension. |
|
Ah I messed up the link in my previous post. I am not sure if we need more of this. It can certainly make sense to have an extra error type though. |
|
As for multiple extensions: And to increase visual difference I would add a convenience function that takes a single vector and calls the vector of vectors function internally. |
e0ce661 to
2232d24
Compare
|
The macro was actually pretty simple to implement and makes usability and readability a lot better. To create methods and even specify keyword arguments. |
|
I have also moved everything to a package https://github.com/jpthiele/ExtensionErrors.jl/ |
2232d24 to
7b84348
Compare

Thanks, Philip, let's discuss this.