develooper Front page | perl.perl6.users | Postings from October 2018

routine declaration line question

Thread Next
From:
ToddAndMargo
Date:
October 4, 2018 01:07
Subject:
routine declaration line question
Message ID:
dfeadef4-f526-300b-144f-d7b9cc6ce2e6@zoho.com
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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About