Re: crossing lists

2005-10-27 Thread Craig DeForest
If PDL-like threading syntax is adopted, this is trivial. In PDL: $a = pdl(1,2); $b = pdl(3,4); $c = $a->(*1) * $b; print $c; yields the output: [ [3 4] [6 8] ] The '(*1)' inserts a dummy dimension into $a, making it a 1x2-array rather than a 2-array. Then th

crossing lists

2005-10-27 Thread Darren Duncan
Not sure if this matter was resolved on a previous discussion, but here goes ... I would like to have a simple way to combine 2 array where every element of each array is combined with every element of the other array; this can also chain or scale to handle any number of arrays. For now lets

Role Method Conflicts and Disambiguation

2005-10-27 Thread Stevan Little
Hello all, I have a question about method conflict resolution works for roles, and I cannot seem to find this in any of the Apoc/Syn documents. Here is the basic issue: role Foo { method foo { ... } method bar { ... } # we will use this later :) } role Bar { method foo { ... }

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-27 Thread Rob Kinyon
On 10/27/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Thu, Oct 27, 2005 at 05:37:13AM -0400, Rob Kinyon wrote: > : Will I be able to do something like: > : > : package Foo; > > Hmm, you just started in Perl 5 mode. > > : $*VERSION = 1.3.2; > > Perl 5 would get confused here, so I'm presuming Perl

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-27 Thread Larry Wall
On Thu, Oct 27, 2005 at 05:37:13AM -0400, Rob Kinyon wrote: : Will I be able to do something like: : : package Foo; Hmm, you just started in Perl 5 mode. : $*VERSION = 1.3.2; Perl 5 would get confused here, so I'm presuming Perl 6. But Perl 6 isn't likely to let you override the global run-tim

Re: Is there a way to generate an object without new?

2005-10-27 Thread Larry Wall
On Thu, Oct 27, 2005 at 01:30:44PM -0600, Luke Palmer wrote: : On 10/27/05, Yiyi Hu <[EMAIL PROTECTED]> wrote: : > What I want to do, is a bit like... : > : > class A { : > has $.b; : > method show { "$.b".say }; : > }; : > : > A( b => 5 ).show;` : : Yes, I definitely want this to be the way that

Re: Is there a way to generate an object without new?

2005-10-27 Thread Juerd
Matt Fowles skribis 2005-10-27 15:52 (-0400): > > This is how some other language construct objects, but not how Perl does > > it. In other words: you should not want this. > How does that logically follow? They are two ways of expressing what I think. If they said exactly the same thing, I wouldn

Re: Is there a way to generate an object without new?

2005-10-27 Thread Matt Fowles
Juerd~ On 10/27/05, Juerd <[EMAIL PROTECTED]> wrote: > Yiyi Hu skribis 2005-10-28 3:17 (+0800): > > class A { > > has $.b; > > method show { "$.b".say }; > > }; > > A( b => 5 ).show;` > > This is how some other language construct objects, but not how Perl does > it. In other words: you should not

Re: Is there a way to generate an object without new?

2005-10-27 Thread Juerd
Yiyi Hu skribis 2005-10-28 3:17 (+0800): > class A { > has $.b; > method show { "$.b".say }; > }; > A( b => 5 ).show;` This is how some other language construct objects, but not how Perl does it. In other words: you should not want this. Perhaps it is possible to have a class export a sub to its

Re: Is there a way to generate an object without new?

2005-10-27 Thread Luke Palmer
On 10/27/05, Yiyi Hu <[EMAIL PROTECTED]> wrote: > What I want to do, is a bit like... > > class A { > has $.b; > method show { "$.b".say }; > }; > > A( b => 5 ).show;` Yes, I definitely want this to be the way that case type instances are created: all those .news everywhere could get annoying. An

Is there a way to generate an object without new?

2005-10-27 Thread Yiyi Hu
What I want to do, is a bit like... class A { has $.b; method show { "$.b".say }; }; A( b => 5 ).show;` Thanks, Xinming

Re: +$arg changed to :$arg

2005-10-27 Thread TSa
HaloO, Juerd wrote: This aside, you could of course just double the colon. Or use a semicolon. Semicolon would give me the mnemonic of 'end of statement' seperating the dispatched part from the checked part of the signature. Or it reminds one of the array and hash slicing. Should we call dispa

Re: +$arg changed to :$arg

2005-10-27 Thread Rob Kinyon
On 10/27/05, TSa <[EMAIL PROTECTED]> wrote: > HaloO, > > Larry Wall wrote: > > > : Yes, and dispatch as a runtime keyed access into a code multitude. > > : The covariant part of the method's sig! The code equivalent to keyed > > : data access into hashes. > > > > Um, yeah. Won't play in Peoria, th

Re: +$arg changed to :$arg

2005-10-27 Thread TSa
HaloO, Larry Wall wrote: : Yes, and dispatch as a runtime keyed access into a code multitude. : The covariant part of the method's sig! The code equivalent to keyed : data access into hashes. Um, yeah. Won't play in Peoria, though. Where or what is Peoria? What I mean with the covariant pa

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-27 Thread Rob Kinyon
On 10/26/05, Larry Wall <[EMAIL PROTECTED]> wrote: > On Wed, Oct 26, 2005 at 07:35:05PM -0700, chromatic wrote: > : On Wed, 2005-10-26 at 21:58 -0400, Rob Kinyon wrote: > : > : > Plus, the argument is a straw man. Instead of: > : > > : > class Some::Class is also { > : > } > : > > : > you w

Re: Ways to add behavior

2005-10-27 Thread Michele Dondi
On Wed, 26 Oct 2005, Rob Kinyon wrote: I'd like to take this moment and point to my somewhat hand-wavy metamodel proposal from last week. When Stevan and I were talking about this, we called it a "quark." "Atom" also works quite nicely, but quarks are cooler. They're also colorful. Does this m