Rod Adams wrote:
How do I specify the signature of a context-sensitive function?
    sub foo() returns (what?) {
        return want ~~ Scalar ?? cheap_integer_result :: List_of_Sheep;
    }
I suspect a typed junction would look like : "Junction of Int|Str".

Not quite.  AIUI that means a Junction of which the members are Int or Str.

This is how I've been writing it:

  sub foo() returns Scalar|List {
      return want ~~ Scalar ?? cheap_integer_result :: List_of_Sheep;
  }

I think the default return type of unlabeled subs would be:

  returns Void|Scalar|List

but of course $?SELF =:= none(@Larry) ;)

Sam.

Reply via email to