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

Type variables vs type literals

Thread Next
Autrijus Tang
June 29, 2005 18:28
Type variables vs type literals
Message ID:
Currently, does this:

    sub foo (::T $x, ::T $y) { }

and this:

    sub foo (T $x, T $y) { }

Means the same thing, namely

   a) if the package T is defined in scope, use that as the
      type constraint for $x and $y

   b) otherwise, set ::T to be the most immediate common supertype
      of $x and $y.

Is this understanding correct?  I'd like to disambiguate the two cases
by making ::T in parameter list to always mean type variable (sense b),
and the bare T always mean type name (sense a)?


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