On 10/2/18 6:09 PM, Curt Tilmes wrote:


On Tue, Oct 2, 2018 at 9:04 PM ToddAndMargo <toddandma...@zoho.com <mailto:toddandma...@zoho.com>> wrote:

    Not to put the cart before the horse, having not read those
    references yet, but did the crypto line forget the --> return?


https://docs.perl6.org/type/Signature#Constraining_return_types



It is not sinking in.  Every line uses -->

     sub greeting1(Str $name  --> Str) { say "Hello, $name" } # Valid
     sub greeting2(Str $name, --> Str) { say "Hello, $name" } # Valid

     sub favorite-number1(--> 42) {        } # OUTPUT: 42
     sub favorite-number2(--> 42) { return } # OUTPUT: 42

Why do the above all use "-->" and

sub postcircumfix:<[ ]>(@container, **@index, :$k, :$v, :$kv, :$p, :$exists, :$delete)

does not?

Yours in confusion,
-T

Reply via email to