develooper Front page | perl.perl6.language | Postings from May 2005

"returns" and context

Thread Next
Gaal Yahas
May 31, 2005 17:25
"returns" and context
Message ID:
How do I specify the signature of a context-sensitive function?

     sub foo() returns (what?) {
         return want ~~ Scalar ?? cheap_integer_result :: List_of_Sheep;

If it were two subs, one would "is returns" Int and the other List of
Sheep. The draft S29 uses things like Int|List to express this kind
of thing but that looks weird to me (how would you return a typed
junction?). S06 and E06 don't raise this issue.

Gaal Yahas <>

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