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

Re: class interface of roles

Thread Previous | Thread Next
From:
Jonathan Lang
Date:
October 18, 2006 13:32
Subject:
Re: class interface of roles
Message ID:
ef30550b0610181332y722ff7b0r3db6b79c8485a11a@mail.gmail.com
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 course, conjectural.  You really have
>
>     does set(A,B,C)

I wasn't aware that you were using set semantics there; but other than
that clarification, I knew exactly what Unordered is - see below.

> The | notation is mentioned in S012:1029, by the way.  Obviously you
> still haven't quite memorized all the synopses.  :-)

Actually, I was very well aware of that fact.  The above was a
proposal for changing S12, for the express purpose of making the
syntax for unordered composition at run-time look like the syntax for
unordered composition at compile-time as much as possible (by the
principle of least surprise).  Since this would remove the current
syntax for doing ordered composition at runtime, and given that
ordered composition at runtime is not something we want to lose, I was
also proposing a replacement syntax for it.  So instead of

    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 composition
    $x does A & does B & does C; # ordered composition
    $y does A does B does C; # unordered composition

Same capabilities, but less cognitive dissonance.

Mind you, I don't really care what syntax gets used for ordered
composition; just as long as it isn't "does A does B does C".

-- 
Jonathan "Dataweaver" Lang

Thread Previous | Thread Next


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