Re: overloading the variable declaration process

2006-02-14 Thread Stevan Little
On 2/12/06, Thomas Sandlass <[EMAIL PROTECTED]> wrote: > > > IIRC, you can always create a new method for a class, even outside of > > > its definition, simply by ensuring that the first parameter to be > > > passed in will be an object of that type: > > > > > > method bark (Dog $_) { ... } > > >

Re: overloading the variable declaration process

2006-02-12 Thread Jonathan Lang
Thomas Sandlass wrote: > > > or maybe > > > > > > method Dog.bark () { ... } > > > > Yes that works too. > > Shouldn't that read Dog::bark? Why the dot? Because I'm not 100% with the proper syntax of things. The intent was to add a bark() method to Dog during runtime. -- Jonathan "Dataweaver"

RE: overloading the variable declaration process

2006-02-12 Thread Thomas Sandlass
Stevan Little wrote: > ^Dog is an instance of the MetaClass, while Dog (no ^ sigil) is the > "class" (actually it's a prototypical instance of the class which the > metaclass ^Dog describes, but you dont really need to know that to use > it). > > ^Dog.can(bark) # false > Dog.can(bark) # true

Re: overloading the variable declaration process

2006-02-09 Thread Jonathan Lang
Stevan Little wrote: > Jonathan Lang wrote: > > OK; apparently, what I meant when I asked "what methods and attributes > > does ^Dog have?" is what you're talking about when you speak of which > > methods ^Dog will respond to. To me, an object has whatever methods > > that it responds to. > > I di

Re: overloading the variable declaration process

2006-02-09 Thread Stevan Little
On 2/9/06, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Stevan Little wrote: > > Jonathan Lang wrote: > > > OK. To help me get a better idea about what's going on here, what > > > sorts of attributes and methods would ^Dog have? > > > > Well, a metaclass describes the behaviors and attributes of a c

Re: overloading the variable declaration process

2006-02-09 Thread Jonathan Lang
Stevan Little wrote: > Jonathan Lang wrote: > > OK. To help me get a better idea about what's going on here, what > > sorts of attributes and methods would ^Dog have? > > Well, a metaclass describes the behaviors and attributes of a class, > and ^Dog is an *instance* of the metaclass. So actually

Re: overloading the variable declaration process

2006-02-09 Thread Stevan Little
On 2/8/06, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Stevan Little wrote: > > Yes, that is correct, because: > > > > Dog.isa(Dog) # true > > $spot.isa(Dog) # true > > ^Dog.isa(Dog) # false > > > > In fact ^Dog isa MetaClass (or Class whatever you want to call it). > > > > At least that is how I

Re: overloading the variable declaration process

2006-02-08 Thread Jonathan Lang
Stevan Little wrote: > Yes, that is correct, because: > > Dog.isa(Dog) # true > $spot.isa(Dog) # true > ^Dog.isa(Dog) # false > > In fact ^Dog isa MetaClass (or Class whatever you want to call it). > > At least that is how I see/understand it. OK. To help me get a better idea about what's goin

Re: overloading the variable declaration process

2006-02-08 Thread Stevan Little
On 2/8/06, Jonathan Lang <[EMAIL PROTECTED]> wrote: > Consider "my Dog $spot". From the Perl6-to-English Dictionary: > Dog: a dog. > $spot: the dog that is named Spot. > ^Dog: the concept of a dog. > > Am I understanding things correctly? > > If so, here's what I'd expect: a dog can bark, or

Re: overloading the variable declaration process

2006-02-08 Thread Jonathan Lang
Consider "my Dog $spot". From the Perl6-to-English Dictionary: Dog: a dog. $spot: the dog that is named Spot. ^Dog: the concept of a dog. Am I understanding things correctly? If so, here's what I'd expect: a dog can bark, or Spot can bark; but the concept of a dog cannot bark: can Dog "b

Re: overloading the variable declaration process

2006-02-08 Thread Larry Wall
On Tue, Feb 07, 2006 at 07:32:18PM -0500, Stevan Little wrote: : On 2/7/06, Matt Fowles <[EMAIL PROTECTED]> wrote: : > Stevan~ : > : > I am going to assume that you intended to reply to perl 6 language, : > and thus will include your post in its entirety in my response. : : Yes, sorry... I missed

Re: overloading the variable declaration process

2006-02-08 Thread Matt Fowles
Stevan~ On 2/7/06, Stevan Little <[EMAIL PROTECTED]> wrote: > > > After all Foo is just a specific instance of the class Class. > > Shhh... class objects don't exist ... I was never here,... I will I > count to three and when I snap my fingers you will awaken and will > have forgotten all about cl

Re: overloading the variable declaration process

2006-02-07 Thread Stevan Little
On 2/7/06, Matt Fowles <[EMAIL PROTECTED]> wrote: > Stevan~ > > On 2/7/06, Stevan Little <[EMAIL PROTECTED]> wrote: > > > > Well, to be totally honest, I think only Larry truely understands > > their usage, but to the best of my understanding they are intented to > > serve a number of roles; > > I

Re: overloading the variable declaration process

2006-02-07 Thread Matt Fowles
Stevan~ On 2/7/06, Stevan Little <[EMAIL PROTECTED]> wrote: > > Well, to be totally honest, I think only Larry truely understands > their usage, but to the best of my understanding they are intented to > serve a number of roles; I agree with you about that, which is part of what bothers me. > >

Re: overloading the variable declaration process

2006-02-07 Thread Stevan Little
On 2/7/06, Matt Fowles <[EMAIL PROTECTED]> wrote: > Stevan~ > > I am going to assume that you intended to reply to perl 6 language, > and thus will include your post in its entirety in my response. Yes, sorry... I missed the "reply to all" button on the gmail UI by a few pixels I guess. Thank you

Re: overloading the variable declaration process

2006-02-07 Thread Matt Fowles
Stevan~ I am going to assume that you intended to reply to perl 6 language, and thus will include your post in its entirety in my response. On 2/7/06, Stevan Little <[EMAIL PROTECTED]> wrote: > On 2/7/06, Matt Fowles <[EMAIL PROTECTED]> wrote: > > Larry~ > > > > On 2/7/06, Larry Wall <[EMAIL PROT

Re: overloading the variable declaration process

2006-02-07 Thread Matt Fowles
Larry~ On 2/7/06, Larry Wall <[EMAIL PROTECTED]> wrote: > > Indeed, and the modeling point of view is that $pipe is *also* just > a representation of the Pipe. Neither Pipe nor $pipe is the thing > itself. Most computer programs are about Something Else, so computer > languages should be optimiz

Re: overloading the variable declaration process

2006-02-07 Thread Larry Wall
On Mon, Feb 06, 2006 at 10:41:02PM -0500, Matt Fowles wrote: : Larry~ : : On 2/6/06, Larry Wall <[EMAIL PROTECTED]> wrote: : > This is mostly motivated by linguistics rather than computer science, : > insofar as types/classes/roles in natural language are normally : > represented by generic object

Re: overloading the variable declaration process

2006-02-07 Thread Ashley Winters
On 2/6/06, Larry Wall <[EMAIL PROTECTED]> wrote: > So the basic answer to you question is, I think, yes. If Dog chooses > to always return true for .defined, then (in Haskell terms) it's more > like a Just type than a Maybe type. Perl 6's objects like to be Maybe > types by default, but you can o

Re: overloading the variable declaration process

2006-02-06 Thread Matt Fowles
Larry~ On 2/6/06, Larry Wall <[EMAIL PROTECTED]> wrote: > This is mostly motivated by linguistics rather than computer science, > insofar as types/classes/roles in natural language are normally > represented by generic objects rather than "meta" objects. When I > ask in English: > > Can a dog

Re: overloading the variable declaration process

2006-02-06 Thread Luke Palmer
On 2/6/06, Larry Wall <[EMAIL PROTECTED]> wrote: > This is mostly motivated by linguistics rather than computer science, > insofar as types/classes/roles in natural language are normally > represented by generic objects rather than "meta" objects. When I > ask in English: > > Can a dog bark? >

Re: overloading the variable declaration process

2006-02-06 Thread Darren Duncan
At 3:02 PM +0800 2/6/06, Audrey Tang wrote: On 2/6/06, Darren Duncan <[EMAIL PROTECTED]> wrote: Speaking briefly, I would like it if Perl 6 provided a way for a class (or role, or meta-class, etc) to declare that all variables declared to be of that type are automatically/implicitly set to a

Re: overloading the variable declaration process

2006-02-06 Thread Larry Wall
On Sun, Feb 05, 2006 at 07:26:09PM -0800, Darren Duncan wrote: : Part way through writing this, I had a brief chat on #perl6 with : stevan (and apparently the meta-model is still quite in flux) and he : said my question was related to Larry's "class but undef" idea, and : that Larry should talk

Re: overloading the variable declaration process

2006-02-05 Thread Audrey Tang
On 2/6/06, Darren Duncan <[EMAIL PROTECTED]> wrote: > Speaking briefly, I would like it if Perl 6 provided a way for a > class (or role, or meta-class, etc) to declare that all variables > declared to be of that type are automatically/implicitly set to a > particular value at declaration time, so t

overloading the variable declaration process

2006-02-05 Thread Darren Duncan
All, Speaking briefly, I would like it if Perl 6 provided a way for a class (or role, or meta-class, etc) to declare that all variables declared to be of that type are automatically/implicitly set to a particular value at declaration time, so that they are not undefined if the programmer usin