Skip to content
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

Allow return without expression #602

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

skasti
Copy link
Contributor

@skasti skasti commented Oct 9, 2024

Small change to allow writing return #5070 instead of return [#5070] and similar.
Still allows the old way of returning only using expressions, but I find this syntax less error-prone.

Also explicitly setting _value to 0 if no value is returned, as I have had some confusion where I get a unexpected _value but _value_returned is 0 😅

@terjeio
Copy link
Contributor

terjeio commented Oct 10, 2024

This is a breaking change? Returning an explicit value with e.g. return [123.456] will no longer work?
I am currently without access to a controller so cannot check.

FYI I am going to add expresssion support to ENDSUB and clearing of _value and _value_returned on CALL since these were not in compliance with the LinuxCNC spec.

@skasti
Copy link
Contributor Author

skasti commented Oct 11, 2024

This is a breaking change? Returning an explicit value with e.g. return [123.456] will no longer work? I am currently without access to a controller so cannot check.

No, it just means you can use any of:

return 1
return [1]
return #5070
return [#<something>+10]
etc

FYI I am going to add expresssion support to ENDSUB and clearing of _value and _value_returned on CALL since these were not in compliance with the LinuxCNC spec.

I don't think I understand. Will read again tomorrow and see if brain is braining :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants