With the recent discussion on type sigils, and the fact that Pugs
is moving toward the OO core, I'd like to inquire how the following
statements evaluate (or not):

    # Compile time type arithmetic?
    ::Dual ::= ::Str | ::Num;
    $*Dual ::= ::Str | ::Num;

    # Run time type arithmetic?
    my ::dual := ::Str | ::Num;

    # Type Instantiation?
    sub apply (&fun<::a> returns ::b, ::a $arg) returns ::b {
        &fun($arg);
    }

    # Does Role live in the same namespace as Types/Classes/Modules/Packages?
    my ::role = role { ... };

    # Can class take type parameters like Roles cna?
    class Pet[Type $petfood] {
        method feed (::($petfood) $food) {...}
    }

    # Single colon as tuple composer?
    my $Triple          ::= :(Bool, Int, Str);
    my $TripleTuple     ::= :($Triple, $Triple);
    my &pair_with_int   ::= -> Type ::t { :(::t, Int) };

Thanks,
/Autrijus/

Attachment: pgpL98kTyC7rl.pgp
Description: PGP signature

Reply via email to