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

Re: new sigil

From:
Luke Palmer
Date:
October 20, 2005 09:00
Subject:
Re: new sigil
Message ID:
7ca3f0160510200859g20fe37a2na7644a054d13dc3c@mail.gmail.com
On 10/20/05, Larry Wall <larry@wall.org> wrote:
> Another thing I didn't mention is that that binds both the variable
> and its class.  But the $ variable is of course optional after the
> type, so you could just write that
>
>     sub sametype (¢T, ¢T) {...}
>
> if you don't actually care about $x and $y.  Basically, ¢T captures
> the type of the associated scalar in any lvalue or declarative context,
> whether or not hte scalar itself is captured.

So it's a type position thing if it can be.  Good.  (I wonder if,
since it's allowed in term position, we will come up with ambiguities)

How about this:

    sub foo(c|T $x) {
        my sub util (c|T $in) {...}
        util($x)
    }

Is that c|T in util() a new, free type variable, or am I asserting
that the type of util()'s argument must be the same type as $x?

Luke



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About