Re: $_ defaulting for mutating ops

2005-11-02 Thread Michele Dondi
On Fri, 28 Oct 2005, Ruud H.G. van Tol wrote: Or RPN-like: $x #= 2* 1+ 3/; Being a big fan of RPN myself (and considering it quite natural), I'd appreciate very much such a feature. I had asked myself about RPN features in P6, albeit in a probably unreasonable fashion: http://www.nntp.pe

Re: should roles be parameterized?

2005-11-02 Thread Michele Dondi
On Sat, 29 Oct 2005, Christopher D. Malon wrote: For the non-mathematically inclined: A field is a set with two binary operations, + and *. Under either operation (+ or *), the set is an abelian (= commutative) group, and a field has a distributive property: a * (b + c) = a*b + a*c. An easy exam

Re: $_ defaulting for mutating ops

2005-11-02 Thread Michele Dondi
On Fri, 28 Oct 2005, John Williams wrote: But IMHO the reduction in typing for this relatively minor issue is not really worth the surprise to newbies at seeing operandless operators. I don't buy that argument as newbies are already exposed to all sorts of surprises including operandless oper

Re: Role Method Conflicts and Disambiguation

2005-11-02 Thread Rob Kinyon
On 11/1/05, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Rob Kinyon wrote: > > > 1. choose one of a set of available methods to call its own. > > > 2. create a version of its own. > > > 3. pass the buck. > > > > #1 and #2 are identical. Stevan and I have always viewed #1 as a > > special case of #2.

Re: $_ defaulting for mutating ops

2005-11-02 Thread Rob Kinyon
On 11/2/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > On Fri, 28 Oct 2005, John Williams wrote: > > > But IMHO the reduction in typing for this relatively minor issue is not > > really worth the surprise to newbies at seeing operandless operators. > > I don't buy that argument as newbies are alrea

syntax-variants, RPN (was: Re: $_ defaulting for mutating ops)

2005-11-02 Thread Ruud H.G. van Tol
Michele Dondi: > Ruud H.G. van Tol: >> Or RPN-like: >> >> $x #= 2* 1+ 3/; > > Being a big fan of RPN myself (and considering it quite natural), I'd > appreciate very much such a feature. I had asked myself about RPN > features in P6, albeit in a probably unreasonable fashion: > > http://www.nntp.

Re: $_ defaulting for mutating ops

2005-11-02 Thread John Williams
On Wed, 2 Nov 2005, Michele Dondi wrote: > On Fri, 28 Oct 2005, John Williams wrote: > > But IMHO the reduction in typing for this relatively minor issue is not > > really worth the surprise to newbies at seeing operandless operators. > > I don't buy that argument as newbies are already exposed to

Re: $_ defaulting for mutating ops

2005-11-02 Thread Sam Vilain
On Wed, 2005-11-02 at 11:46 -0700, John Williams wrote: > It is not so much an operator, as it is a subroutine with really strange > syntax, and the side-effect of changing the $_ variable. You need to use > an operator to get it to affect a different variable. operators _are_ subroutines. There

Re: $_ defaulting for mutating ops

2005-11-02 Thread Sam Vilain
On Wed, 2005-11-02 at 09:03 -0500, Rob Kinyon wrote: > I think the difference comes from the Principle of Least Surprise. The > various operators being discussed in this thread are all operators > which are in languages that have common use - C, C++, Java, the .Net > stack, etc. Regexen and the var

Re: $_ defaulting for mutating ops

2005-11-02 Thread Juerd
Sam Vilain skribis 2005-11-03 11:01 (+1300): > Does ++; mean &postfix:<++> or &prefix:<++> ? I no longer think $_ defaulting for mutating ops is a good idea, but to answer your question, read the original post: all these would imply the LHS, so that makes ++ postfix. Juerd -- http://convolutio

Re: Role Method Conflicts and Disambiguation

2005-11-02 Thread Jonathan Scott Duff
On Tue, Nov 01, 2005 at 04:02:04PM -0800, Jonathan Lang wrote: > True enough; but it needn't be true that d have the same tools > available to resolve the conflicts that c has. > > There are three ways that a role can deal with a conflict: > > 1. choose one of a set of available methods to call i

Re: Role Method Conflicts and Disambiguation

2005-11-02 Thread Yuval Kogman
On Wed, Nov 02, 2005 at 16:37:29 -0600, Jonathan Scott Duff wrote: > On Tue, Nov 01, 2005 at 04:02:04PM -0800, Jonathan Lang wrote: > > True enough; but it needn't be true that d have the same tools > > available to resolve the conflicts that c has. > > > > There are three ways that a role can dea

Re: Role Method Conflicts and Disambiguation

2005-11-02 Thread Jonathan Lang
Jonathan Scott Duff wrote: > People keep using the word "hierarchy" when talking about roles and I > keep thinking that it is the one word that definitely does NOT apply. > Heirarchies are for classes and inheritance relationships, not roles > and composition. > > In my world view, a role that is c

Re: Role Method Conflicts and Disambiguation

2005-11-02 Thread Luke Palmer
On 11/2/05, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Let's say you have this: > > role A {method foo() { code1; } } > role B {method foo() { code2; } } > role C does A does B { > method foo() { A::foo(); } > method bar() { B::foo(); } > } > > Should the following be valid? > > r