suve

awful: function: return

declaration

mixed :return ( mixed $RETVAL )

summary

Immediately break out of a function call, returning RETVAL. When called inside the main function, acts the same as :exit.

example

# Recursive n! function. (Bad idea.)
!fun :n! $NUM
    !if $NUM
        :return :mul $NUM :n! :sub $NUM i1
    !else
        :return i1
    !fi
!nuf

:writeln s'10! = ' :n! i10

wikipage modified on 2014/0601/2317