On Sat, Sep 03, 2005 at 11:45:33 +0300, Yuval Kogman wrote a lot.
I'd like to summarize:
* if operators are not special than they are defined in perl 6
(maybe)
* if operators are defined in terms of other operators, then
overriding an operator may interfere with t
On Thu, Sep 01, 2005 at 17:12:51 +, Luke Palmer wrote:
> On 9/1/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> > On Wed, Aug 31, 2005 at 13:43:57 -0600, Luke Palmer wrote:
> > > Uh yeah, I think that's what I was saying. To clarify:
> > >
> > > sub foo (&prefix:<+>) { 1 == 2 }# 1 and 2
On 9/1/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 31, 2005 at 13:43:57 -0600, Luke Palmer wrote:
> > Uh yeah, I think that's what I was saying. To clarify:
> >
> > sub foo (&prefix:<+>) { 1 == 2 }# 1 and 2 in numeric context
> > foo(&say); # nothing printed
> >
> > But
On Wed, Aug 31, 2005 at 13:43:57 -0600, Luke Palmer wrote:
> Uh yeah, I think that's what I was saying. To clarify:
>
> sub foo (&prefix:<+>) { 1 == 2 }# 1 and 2 in numeric context
> foo(&say); # nothing printed
>
> But:
>
> sub foo (&prefix:<+>) { +1 == +2 }
> foo(&say);
On 8/31/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 31, 2005 at 04:56:25 -0600, Luke Palmer wrote:
>
> > (That is, lexically binding &prefix:<+> does not change things in
> > numeric context; only when there's actually a + in front of them)
>
> Unless you override &prefix:<+> ?
>
>
On Wed, Aug 31, 2005 at 04:56:25 -0600, Luke Palmer wrote:
> (That is, lexically binding &prefix:<+> does not change things in
> numeric context; only when there's actually a + in front of them)
Unless you override &prefix:<+> ?
sub foo (&prefix:<+>) { +1 }
--
() Yuval Kogman <[EMAIL PROTECT
Let me just clarify something that my intuition led me to believe:
sub foo(&infix:<+>) { 1 + 2 }
sub bar($a, $b) { say "$a,$b" }
foo(&bar); # "1,2"
That is, operator names can be lexically bound just like any other
name. Also, this doesn't have any affect on implicit coercions, e