Hyper operator corner case?

2005-04-12 Thread David Christensen
Hey folks, I wanted to delurk and address an issue that may need clarification in regards to hyper operators. Quoting S03: If one argument is insufficiently dimensioned, Perl "upgrades" it: (3,8,2,9,3,8) >>-<< 1; # (2,7,1,8,2,7) Now in this example case, it's pretty clear that the s

Re: Hyper operator corner case?

2005-04-13 Thread Brent 'Dax' Royal-Gordon
David Christensen <[EMAIL PROTECTED]> wrote: > Example: >(1,2,3,4,5) >>+<< (1,2) > > Is this equivalent to: > > a) (1,2,3,4,5) >>+<< (1,2,undef,undef,undef) (undef padding) > b) (1,2,3,4,5) >>+<< (1,2,1,2,1) (repetition) > c) (1,2,3,4,5) >>+<< (1,2,2,2,2) (stretching) > d) (1,2) >>+<< (1,2) (

Re: Hyper operator corner case?

2005-04-13 Thread Thomas Sandlaß
Brent 'Dax' Royal-Gordon wrote: IIRC, it's f) (1,2,3,4,5) >>+<< (1,2,$identity,$identity,$identity), where $identity's value is determined by a table something like this: In the case of &infix_circumfix_meta_operator:{'»','«'}:(List,List:&op) there's no "upgrade"---to use the S03 term. A simple "

Re: Hyper operator corner case?

2005-04-14 Thread John Williams
I found where Damain explains the rule as basically "replicate dimensions, extend lengths", using an "identity value" when extending the length. On Wed, 13 Apr 2005, Thomas Sandlaß wrote: > Brent 'Dax' Royal-Gordon wrote: > > IIR

Re: Hyper operator corner case?

2005-04-14 Thread Larry Wall
On Thu, Apr 14, 2005 at 11:08:21AM -0600, John Williams wrote: : Good point. Another one is: how does the meta_operator determine the : "identity value" for user-defined operators? : : (1,2,3,4,5) >>my_infix_op<< (3,2,4) : : Maybe we should say that the excess length is simply copied unchang

Re: Hyper operator corner case?

2005-04-15 Thread Thomas Sandlaß
John Williams wrote: Good point. Another one is: how does the meta_operator determine the "identity value" for user-defined operators? Does it have to? The definition of the identity value---BTW, I like the term "neutral value" better because identity also is a relation between two values---is tha

Re: Hyper operator corner case?

2005-04-17 Thread Roger Hale
Thomas Sandlaà wrote: John Williams wrote: Good point. Another one is: how does the meta_operator determine the "identity value" for user-defined operators? Does it have to? The definition of the identity value---BTW, I like the term "neutral value" better because identity also is a relation betw

Re: Hyper operator corner case?

2005-04-18 Thread Thomas Sandlaß
Roger Hale wrote: One set of cases that doesn't seem to have come up in discussion: (1, 3, 2) >>-<< (83, 84, 81, 80, 85) Should this give (-82, -81, -79, -80, -85) From an arithmetic point of view it should be exactly that. The implementation might need to morph the code though, see below.