-
Notifications
You must be signed in to change notification settings - Fork 19
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
Function calls aren't translated correctly #4
Comments
Hi! Thanks so much for letting me know about this. It's tricky to know whether something is a function or a matrix in MATLAB. The script tries to guess, using a list of common functions and using functions that it sees are defined in the block of code being translated. If the translator misses something, names of functions can be added to the "interpret as functions" list in the advanced options below the translator. I definitely don't recommend translating code and running it as is. The translator is meant to be a time-saver, but still requires learning Julia, manually correcting the translated code, and actually optimizing the code once it is translated. That said, the translator does not currently recognize some functions that don't return anything (second option in the answer here: https://stackoverflow.com/questions/12992619/can-a-function-be-created-in-matlab-that-returns-nothing )—I'll look into fixing that! Thanks again! |
Sure, do understand that - I don't think there's necessarily a solution here apart from maybe mentioning this prominently somewhere, as this is probably a reasonably common problem! |
I added support for functions that don't return anything. Assuming all the code is pasted in together, the function in Aquaman's code should now actually be recognized as a function (yay!). If the function call and the actual function are not entered in together then, of course, the function will not be recognized as a function. Leaving this open (?) since this is a problem that cannot really solved, but can be gradually improved upon. Any ideas or pull requests to make things better are absolutely welcome. (I'm opening a related issue on mapping common MATLAB functions and packages to Julia.) |
MATLAB:
my_function(arg1, arg2)
Julia:
my_function[arg1, arg2]
Came across this bug from a user report on: https://discourse.julialang.org/t/methoderror-no-method-matching-getindex/22496/3
The text was updated successfully, but these errors were encountered: