Perl 6 routines always return *something*; if you don't return anything
explicitly, it will return the result of the last statement/expression, or
Mu as a last resort. (Mu is the "least defined value" in Perl 6. Any is
somewhat more common, but is slightly more defined since it can participate
in junction autothreading.) It's analogous to Perl 5 returning undef if you
don't give it something else to return.

On Wed, Oct 3, 2018 at 9:07 PM ToddAndMargo <toddandma...@zoho.com> wrote:

> Hi All,
>
> In another thread, Timo wrote me:
>
>         The "-->" part of the signature is optional. If there isn't
>         one, it defaults to Mu, which is the type that everything
>         conforms to, i.e. the sub or method that either has "--> Mu"
>         explicitly, or has it by leaving it out, may return
>         absolutely whatever it wants.
>
>         After all, the "-->" part is a constraint, and it gets
>         validated at compile time every time a sub or method
>         returns.
>
> I got to thinking, some routines do not return anything.  Without
> the "-->" constraint, how am I to determine if something is
> being returned?
>
> Yours in confusion,
> -T
>


-- 
brandon s allbery kf8nh
allber...@gmail.com

Reply via email to