RE: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Garrett Goebel
On Mon, 14 Oct 2002, Larry Wall wrote: : We haven't solved the problem of instance methods that want to : reject class invocants at compile time. Though I suppose explicitly : declaring the type of the invocant would have that effect. I'm sure : there are some who would argue (and I might be one

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Mark J. Reed
On 2002-10-14 at 19:58:50, Piers Cawley wrote: > I would expect Class to inherit from Object (along with everything > else). It might be worth looking at a Smalltalk image or two at this > point... You might want to look at _Putting_Metaclasses_To_Work_ by Danforth and Forman - or at Ruby, which f

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Michael Lazzaro
On Monday, October 14, 2002, at 11:57 AM, Trey Harris wrote: >> class SomeClass { >> cmethod class_method {...} # via a keyword >> method instance_method {...} # via another keyword >> sub dont_care_method {...} # check it yourself, as

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Piers Cawley
Austin Hastings <[EMAIL PROTECTED]> writes: > --- Larry Wall <[EMAIL PROTECTED]> wrote: >> If every Object happens to implement the Class interface, merely >> declaring the invocant as a Class would presumably have this effect, >> whether or not MD was in effect. I don't know whether that's a goo

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Trey Harris
In a message dated Mon, 14 Oct 2002, Michael Lazzaro writes: > So if the first two should be shorter than the third, one way to do > that would be something like: > > class SomeClass { > cmethod class_method {...} # via a keyword > method instance_method {

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Michael Lazzaro
On Monday, October 14, 2002, at 10:28 AM, Larry Wall wrote: > On Mon, 14 Oct 2002, Larry Wall wrote: > And I should point out that this approach would be good not just for > type purity, but because it optimizes for the common case. Class > methods > are much rarer than instance methods. And

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Larry Wall
On Mon, 14 Oct 2002, Larry Wall wrote: : We haven't solved the problem of instance methods that want to : reject class invocants at compile time. Though I suppose explicitly : declaring the type of the invocant would have that effect. I'm sure : there are some who would argue (and I might be one

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Austin Hastings
--- Larry Wall <[EMAIL PROTECTED]> wrote: > On Sun, 13 Oct 2002, Michael Lazzaro wrote: > : My temporary hack while writing the proto-recipes was that we'd > have a > : property that would simply declare a method to be a class method, > but > : I'm having a hard time coming up with an acceptable

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Larry Wall
On Sun, 13 Oct 2002, Michael Lazzaro wrote: : My temporary hack while writing the proto-recipes was that we'd have a : property that would simply declare a method to be a class method, but : I'm having a hard time coming up with an acceptable name to suggest for it: : : method foo is class_

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Larry Wall
On Sun, 13 Oct 2002, Trey Harris wrote: : I was going to say the same thing, but then I remembered that Perl 6 : methods, unlike the sub 'methods' in Perl 5, won't get the invocant as the : first real argument--it will be the topic instead. And I don't think you : can do multiple-dispatch on topi

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-14 Thread Larry Wall
On Sun, 13 Oct 2002, Piers Cawley wrote: : I like that idea: : :class SomeClass { : method class_method ( Class $class: ... ) { ... } : method instance_method ( SomeClass $self : ... ) { ... } : method dont_care_method ( $self : ... ) { ... } :} : : Or

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Larry Wall
On Sat, 12 Oct 2002, Me wrote: : I've looked before for discussion of the rationale behind : introducing attr/has and failed to find it. I noticed you : mention Zurich, so perhaps this decision followed from : discussion in living color (as against b+w). : : Anyhow, what was deemed wrong with usi

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Me
> Nothing the matter with "our" for class attributes since they're > already stored in the package if we follow Perl 5's lead. But using > "my" for instance attributes is problematic if we allow a class to > be reopened: > > class Blurfl { > my $.foo; > } > ... > class Blurfl is

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Me
I've looked before for discussion of the rationale behind introducing attr/has and failed to find it. I noticed you mention Zurich, so perhaps this decision followed from discussion in living color (as against b+w). Anyhow, what was deemed wrong with using my/our? And... > class Zap { > my %.za

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Trey Harris
In a message dated Sun, 13 Oct 2002, Piers Cawley writes: > I like that idea: > >class SomeClass { > method class_method ( Class $class: ... ) { ... } > method instance_method ( SomeClass $self : ... ) { ... } > method dont_care_method ( $self : ... ) { ... }

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > On Sat, 12 Oct 2002, Me wrote: > : We also need a signifier for class methods (assuming > : a distinction is made). > : > : Perhaps one could use an initial cap to indicate a class > : attribute/method: > : > : class foo { > : my $bar;# my i

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Larry Wall
On Sat, 12 Oct 2002, Me wrote: : We also need a signifier for class methods (assuming : a distinction is made). : : Perhaps one could use an initial cap to indicate a class : attribute/method: : : class foo { : my $bar;# my is not used for attributes : our $baz;# neither i

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Michael Lazzaro
Trey Harris wrote: > > In a message dated Sun, 13 Oct 2002, Piers Cawley writes: > > I like that idea: > > > >class SomeClass { > > method class_method ( Class $class: ... ) { ... } > > method instance_method ( SomeClass $self : ... ) { ... } > > method dont_care_metho

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Larry Wall
On Fri, 4 Oct 2002, Michael Lazzaro wrote: : Date: Fri, 4 Oct 2002 16:40:04 -0700 : From: Michael Lazzaro <[EMAIL PROTECTED]> : To: [EMAIL PROTECTED] : Subject: Draft Proposal: Declaring Classwide Attributes : : (Disclaimer: My purpose in proposing this is not to recommend it, but : to document