Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[golo-dev] Return from main?

Hello,

I've subscribed with a different e-mail address. Hopefully this webmail
client will not completely mess up the formatting, unlike my primary
account's webmail client. Thanks for the nice replies on my first mail,
and Yannick, thanks for showing the more Golo-ish code :)

Another question: can I do an early return from the main function?

The following code...:

------

module Test

function main = |args| {
    return
}

------

...produces  a "java.lang.VerifyError: Method expects a return value"
traceback. I've also tried "return null" or return an integer, but with
the same result.

I know some people consider it bad/questionable design when having
multiple exit paths in a single function, but especially for
command-line driven tools that need to validate various parameters, etc.
I think this can sometimes be justified.

Kind regards,
Vincent


Back to the top