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

routine declaration line question

Thread Next
October 4, 2018 01:07
routine declaration line question
Message ID:
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

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,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About