I had a problem with some code I was working on. I finally found it.
It was a missing 'return' statement in a subroutine. From my 'C' days I made the mistake
of thinking that 'return' was implied - what I found out was that if a class procedure call a subroutine
a 'return' statement is required. I guess this is the way Aurora (or OOP) works??????
I will now put 'return' at the end of all my routines now.
A return is automatically inserted if one hasn't been used yet. If you have multiple return statements you'll need to add the last one.
sub blah
{
if(a=0)
return -1;
...
return 0;
}
That is just what I had.
It's one thing that I hope is addressed before release. I believe it should always do an implicit return at the end of the function (regardless if the user has specified one or not). The ability "fall through" functions is just not safe, and creates annoyingly hard to find bugs, particularly if you're a C/C++ programmer.
Or at least the compiler should complain. Just my opinion.