foo(1: 2: 3: 4:) ?

2005-05-20 Thread Autrijus Tang
So I'm finally starting to implement multi-level invocants in MMDs. I'd like to sanity check some cases first, though. Are these two assumed to be identical? multi sub foo ($x, $y) multi sub foo ($x, $y : ) But these two are _not_ identical? multi sub foo ($x : $y : $z) multi

Re: hyperoperators and multi-dimensional datastructures

2005-05-20 Thread Anthony Heading
Uri Guttman wrote: i can't spit out the syntax but here is the conceptual way i would do it. we do have multidimensional slices so we could grab each slice (maybe with zip?) and pass that to [+] and then grab the list of results back into a array/matrix with one less dimension than the original.

Re: How do I... create a new meta operator?

2005-05-20 Thread TSa (Thomas Sandlaß)
HaloO Luke, you wrote: I wonder how we specify meta operators that only work on comparators, or only on assignment forms, or etc. etc. etc. Well, Perl6 has got first class Code types, hasn't it? So it's a matter of defining a type hierarchy among the operators and then you can dispatch on them

Re: reduce metaoperator on an empty list

2005-05-20 Thread Randal L. Schwartz
Mark == Mark A Biggar [EMAIL PROTECTED] writes: Mark The usual definition of reduce in most languages that support it, is Mark that reduce over the empty list produces the Identity value for the Mark operation. In Smalltalk, the equivalent of reduce is inject:into:, so a sum reduce looks like:

Re: reduce metaoperator on an empty list

2005-05-20 Thread TSa (Thomas Sandlaß)
John Macdonald wrote: ... (and there may be additional operator attributes that make sense there too, although none come immediately to mind). Well, I wonder why people neglect the fact that the neutral/identity element is not a property of the operator alone?! Besides the associativity and

Re: reduce metaoperator on an empty list

2005-05-20 Thread Mark A. Biggar
John Macdonald wrote: Is there a built-in operator that doesn't have a meaningful identity value? I first thought of exponentiation, but it has an identity value of 1 - you just have to realize that since it is a right associative operator, the identity has to be applied from the right. Well the

Re: reduce metaoperator on an empty list

2005-05-20 Thread TSa (Thomas Sandlaß)
Mark A. Biggar wrote: Well the identity of % is +inf (also right side only). I read $n % any( $n..Inf ) == $n. The point is there's no unique right identity and thus (Num,%) disqualifies for a Monoid. BTW, the above is a nice example where a junction needn't be preserved :) E.g. if XY is left

lazy context

2005-05-20 Thread Yuval Kogman
Hola, Some of us on #perl6 bitched once more about how lazy will make our IO brain hurt a lot. The concensus is that a lazy context has not been discussed yet. Here is a proposal for lazyness defined with coroutines. we have a lazy modifier: my $a = lazy { get_value(5, 10) };

Re: How do I... invoke a method reference

2005-05-20 Thread TSa (Thomas Sandlaß)
C. Scott Ananian wrote: I think Ingo was trying to explicitly specify the normally-implicit invocant; ie, invoke the method via the reference *without* using a '.'. If this is possible (and I think it is), it's not (yet) clear what the syntax would be. Maybe $ref(Foo.new():) I think for MMD

Re: Complex Arithmetic

2005-05-20 Thread Edward Cherlin
On Thursday 19 May 2005 09:39, Luke Palmer wrote: On 5/19/05, Edward Cherlin [EMAIL PROTECTED] wrote: It turns out that the domain and range and the location of the cut lines have to be worked out separately for different functions. Mathematical practice is not entirely consistent in

Re: hyperoperators and multi-dimensional datastructures

2005-05-20 Thread Edward Cherlin
On Thursday 19 May 2005 12:48, Uri Guttman wrote: LP == Luke Palmer [EMAIL PROTECTED] writes: LP On 5/18/05, Anthony Heading [EMAIL PROTECTED] wrote: Is there a way to target hyperoperators at different axes of a multi-dimensional array? This is an attractive feature of various

Re: [unclassified] Re: reduce metaoperator on an empty list

2005-05-20 Thread Edward Cherlin
On Thursday 19 May 2005 19:51, Sam Vilain wrote: Edward Cherlin wrote: Here is the last answer from Ken Iverson, who invented reduce in the 1950s, and died recently. file:///usr/share/j504/system/extras/help/dictionary/intro28 .htm

Re: lazy context

2005-05-20 Thread C. Scott Ananian
On Fri, 20 May 2005, Yuval Kogman wrote: then it is not finalized into a real value. Here's how the range operator would be implemented: sub infix:.. ($from, $to where { $to $from }){ reverse $to .. $from } sub infix:.. ($from, $to) { lazy gather { while ($from =

Re: lazy context

2005-05-20 Thread Patrick R. Michaud
On Fri, May 20, 2005 at 05:15:24PM -0400, C. Scott Ananian wrote: On Fri, 20 May 2005, Yuval Kogman wrote: then it is not finalized into a real value. Here's how the range operator would be implemented: sub infix:.. ($from, $to where { $to $from }){ reverse $to .. $from }

Re: lazy context

2005-05-20 Thread Yuval Kogman
On Fri, May 20, 2005 at 17:15:24 -0400, C. Scott Ananian wrote: This is very elegant. It might be worthwhile for someone to attempt to define a 'core perl' set of operators, etc, so that the 'rest of perl' can be defined in perl proper... Have a look at synopsis 29... For documentation

Re: reduce metaoperator on an empty list

2005-05-20 Thread mark . a . biggar
Mark A. Biggar wrote: Well the identity of % is +inf (also right side only). I read $n % any( $n..Inf ) == $n. The point is there's no unique right identity and thus (Num,%) disqualifies for a Monoid. BTW, the above is a nice example where a junction needn't be preserved :) If as usual