Let's say that I want
$expression?;
to mean the same thing as the statement
$_ = $expression;
That is, any statement that ends with a '?;' instead of a ';'
evaluates in scalar context instead of void context and stores the
result as the topic '$_'. (I was going to suggest '?' intead of
In "class interface of roles", Dr.Ruud wrote:
And I was on the line of:
role R does A | B | C { ... } # unordered composition
$x does ( A, B, C ) ; # ordered composition
$y does A | B | C ; # unordered composition
but I would like early and late binding to be
Larry Wall wrote:
Though actually, now that I think about it, the cascaded notation
in S12 is illegal according to S03, since "does" is classified as
non-chaining, which implies non-associative.
Wait a minute. Isn't "chaining" specifically referring to the idea
that "A op B op C" implicitly be
"Jonathan Lang" schreef:
> role R does A does B does C { ... } # unordered composition
> $x does A does B does C; # ordered composition
> $y does A | B | C; # unordered composition
>
> I'd like to see it done something like:
>
> role R does A does B does C { ... } # unordered com
HaloO,
Hmm, no one seems to read the article! There actually is another class
GenLocSquare that combines GenSquare and GenPointMixin. With that we
get a modified version of my code as follows:
role GenEqual
{
method equal( : GenEqual $ --> Bool ) {...}
}
role GenPointMixin
{
has Int $.x;
TSa wrote:
And while we're at it, could we also introduce the subtype operator <:
and perhaps >: as the supertype operator? This would come in handy for
expressing type constraints in does clauses.
Isn't one of those called ".does()"?
--
Jonathan "Dataweaver" Lang
Ruud H.G. van Tol wrote:
Larry Wall schreef:
> I suspect ordered composition is going to be rare enough that we can
> simply dehuffmanize it to
>
> $x does A;
> $x does B;
> $x does C;
Maybe use a list-like notation?
What happens when you try to mix ordered and unordered compositi
HaloO
TSa wrote:
I would like "does A & B & C" mean the intersection type of A, B and C.
That is a supertype of all three roles. In addition we might need
negation to get what Jonathan Lang envisoned for the Complex type that
does Num & !Comparable. IOW, I'm opting for a role combination syntax
HaloO,
Larry Wall wrote:
You've got it inside out. Unordered is just "does A | B | C" or
some such, the | there really being coerced to a set construction,
not a junction. In fact, & would work just as well. I only used |
because it's more readable. Autocoercion of junctions to sets is,
of c
Larry Wall schreef:
> I suspect ordered composition is going to be rare enough that we can
> simply dehuffmanize it to
>
> $x does A;
> $x does B;
> $x does C;
Maybe use a list-like notation?
$x does (A, B, C,) ;
$x does (A ; B ; C) ;
$x does [A, B, C,] ;
$x does [A ; B ;
10 matches
Mail list logo