Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Austin Hastings writes: > > ->Â @cp makes about as much sense as subÂ(@cp). C returns a > > list of array references, right? So it binds each one to @cp (the right > > of -> is a subroutine parameter list, remember?). > > Are you saying that subÂ(@cp) is not, in fact, an alias for C ? > > Anyw

RE: Outer product considered useful

2004-03-22 Thread Austin Hastings
> -Original Message- > From: Luke Palmer [mailto:[EMAIL PROTECTED] > > Austin Hastings writes: > > Before this gets simonized, let me add that this seems genuinely > > useful: It provides a way of constructing a loop in a dimension that > > is not really accessible, except via recursion.

Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Austin Hastings writes: > Before this gets simonized, let me add that this seems genuinely > useful: It provides a way of constructing a loop in a dimension that > is not really accessible, except via recursion. > > Luke: Would that have to be > > for outer([EMAIL PROTECTED]) ->Â @cp {...} >

RE: Outer product considered useful

2004-03-22 Thread Austin Hastings
> -Original Message- > From: [EMAIL PROTECTED] > > [EMAIL PROTECTED] (Austin Hastings) writes: > > Before this gets simonized, let me add that this seems > genuinely useful: It provides a way of constructing a loop in a > dimension that is not really accessible, except via recursion. > > Oh

Re: Outer product considered useful

2004-03-22 Thread Simon Cozens
[EMAIL PROTECTED] (Austin Hastings) writes: > Before this gets simonized, let me add that this seems genuinely useful: It provides > a way of constructing a loop in a dimension that is not really accessible, except > via recursion. Oh, it *is* useful, and it's extremely nice to know that someth

RE: Outer product considered useful

2004-03-22 Thread Austin Hastings
> -Original Message- > From: Luke Palmer [mailto:[EMAIL PROTECTED] > ... > Using a permutations module I could make that shorter, but I figure that > since we're already providing C to make looping easier, why not > provide C (perhaps spelled Â)? The outer function would provide >

Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Luke Palmer writes: > Which is of course wrong. > > sub _outer_coro(@prev, @data) is coroutine > { > if (@data) { > _outer_coro([ @prev, @data[0] ], @data[1...]) > } > else { > yield [EMAIL PROTECTED]; > } > } > > sub outer([

Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Luke Palmer writes: > I believe it could be programmed lazily. Like this: > > sub _outer_coro(*$first is context(Scalar), > [EMAIL PROTECTED] is context(Scalar)) > is coroutine > { > if @rest { > _outer_coro [EMAIL PROTECTED]; > }