On Fri, Oct 12, 2018 at 3:32 PM ToddAndMargo via perl6-users <perl6-us...@perl.org <mailto:perl6-us...@perl.org>> wrote:

    But this does not?

          $ p6 'sub RtnOrd( Str $Char --> Str, Int ){return $Char,
    ord($Char)}; say RtnOrd "A";'

          ===SORRY!=== Error while compiling -e
          Malformed return value (return constraints only allowed at the
    end
    of the signature)
          at -e:1
          ------> sub RtnOrd( Str $Char --> Str⏏, Int ){return $Char,
    ord($Char)}; say R

On 10/12/18 12:52 PM, Curt Tilmes wrote:
You could make a subset for the List your're trying to return:

subset liststrint of List where .[0] ~~ Str && .[1] ~~ Int;
sub RtnOrd( Str $Char --> liststrint) ...


I am confused.

I want to get the --> syntax correct for `return $Char, ord($Char)`

Reply via email to