Return in SRON
If you want to return a value from a function, then 'return' attribute is used.
Below is a sample code:
You can return any datatype's variable from a function. You cannot return multiple values from a function. In order to do this, you can use 'List' like this:
You can also set the return type of the function and for that you can use 'type' attribute. 'Type' attribute converts the return value to the specified datatype only if the datatype of returned value is not same.
SRON uses advance return value optimization to enhance code speed and efficiency. Even if the size of the value is too big, it doesn't affect the code performance.
Last updated