-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support octave in-script function definitions #198
Comments
Hi @alvinseville7cf! Your code is a script which has a function definition in the middle of it. That is valid Octave code, but not valid Matlab code. In Matlab, scripts which have local functions must put the function definitions down at the very end of the script, after any statements which are outside function definitions. That's probably what's going on here. |
Thank you @apjanke for answering! I will keep this ticket open as a feature request for supporting in-script functions if the octave mode is on. I had no idea this was possible. |
Yep, it's a thing. The weird thing is that the semantics of it are significantly different from the Matlab version of local functions inside scripts: in Octave, if there's a |
Thats... good to know and clears up a lot! I did read https://octave.org/doc/v6.2.0/Script-Files.html#Script-Files and I was sufficiently confused because the Octave devs also seem to not like talking about semantics too much. :/ Btw, since you seem to know about Octave, and I do want to support it, feel free to add missing bits to #43, or add a whishlist of priorities. |
You ain't wrong. Octave is one of those languages like Perl, where the interpreter implementation kind of is the language spec.
Thanks! Maybe in April? I'm under big day-job deadlines until the end of March. |
Hi @alvinseville7cf your original code now produces this message:
This should be way more clear than before. If you do use
|
Hello! My teacher written the following code:
I want to understand why when I run
mh_lint test.m
I get:The text was updated successfully, but these errors were encountered: