-
Notifications
You must be signed in to change notification settings - Fork 21
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
Type piracy with Base.open
#79
Comments
Thanks for raising this type piracy issue. I fully agree. We should not define a method That is actually the reason why I have always written The same problem does not occur with |
Regarding the I think the solution is not to extend
|
We have just more cleanly separated the low-level API from the high-level API, and the next step will now have to be to polish the high-level API a bit more, such that it is self-sufficient (i.e., can be used without also having to use methods from the low-level API) and also to tidy it up and make sure it follows good Julia API design practice. Resolving this type piracy issue is part of that (but there are also others). |
Yes, I agree. There is already a suitable |
I haven't checked, but it's likely that this causes invalidations too. |
I was just adapting some of my code to use the newest release and I noticed that there appears to be some type piracy with extending
Base.open
. Specifically it gets extended withwhich doesn't use any types defined by LibSerialPort (hence the piracy). While I can see that this is a convenience function (and currently doesn't cause problems), it's probably better not to do it since a string and an integer as inputs is quite generic.
An alternative might be to introduce a string macro/lightweight struct such that you can do
I'd be happy to add the required code if that would help.
The text was updated successfully, but these errors were encountered: