NOTE: This invite-only release of SunSed Alpha is for testing purposes and in no way represents the final quality of the product — join the waitlist (~wait time: 2 weeks). SunSed release date is on March 11, 2022.

RETURN

The RETURN statement behaviour can be grouped into the following:

Inside a Function

A return statement used inside a SunSed function will stop the current function's execution and returns the return statement's argument as the return value of the function.

SECTION function -> user:is_over_21 {
    /*
        purpose  ~> Checks if user is over 21
        tags     ~> 
        access   ~> private
        stable?  ~> No
        schedule ~> 
        examples ~>

        user:is_over_21(18)
        #=> FALSE 

    */
    user:is_over_21 = ƒ($age){
        IF($age > 21) {
            RETURN TRUE
        } ELSE {
            RETURN FALSE
        }
    }
}

Outside of a Function

When executed outside of a function, the RETURN statement will stop the SunSed code from running.

Copyright © SunSed LLC 2013-2021 All rights reserved.