Re: txt vs OO [was: Re: Proposal to make class method non-inheritable]

2005-10-26 Thread Michele Dondi
On Tue, 25 Oct 2005, Larry Wall wrote: But we're trying to design the OO features (indeed, all of Perl 6) such that you can usefully cargo cult those aspects that are of immediate interest without being forced to learn the whole thing. It's not the number one design goal, but it's right up

Re: txt vs OO [was: Re: Proposal to make class method non-inheritable]

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 09:36:48AM +0200, Michele Dondi wrote: : On Tue, 25 Oct 2005, Larry Wall wrote: : : But we're trying to design the OO features (indeed, all of Perl 6) : such that you can usefully cargo cult those aspects that are of : immediate interest without being forced to learn the

Re: txt vs OO [was: Re: Proposal to make class method non-inheritable]

2005-10-26 Thread Andrew Savige
--- Larry Wall wrote: On Tue, Oct 25, 2005 at 05:24:52PM +0200, Michele Dondi wrote: : But maybe that's just me. Whatever, I guess that the {casual,average} : programmer may be scared by its richness and complexity. But we're trying to design the OO features (indeed, all of Perl 6) such

+$arg changed to :$arg

2005-10-26 Thread Larry Wall
I should point out that one of the major changes in the most recent S6 is that named arguments are now marked by : rather than +, with :foo($bar) being the way to declare parameter $bar but give it the external name of foo. A + is now reserved to mark mandatory parameters, though it's redundant

Re: new sigil

2005-10-26 Thread Rob Kinyon
And in fact, its very existence defies another implicit principle of mine, that is, the principle of partial definition: Defining a new type or instance can only break a previously typechecking program by making it ambiguous. The idea behind that is that at some time you may realize that

Re: +$arg changed to :$arg

2005-10-26 Thread Juerd
Larry Wall skribis 2005-10-26 6:44 (-0700): I should point out that one of the major changes in the most recent S6 is that named arguments are now marked by : rather than +, with :foo($bar) being the way to declare parameter $bar but give it the external name of foo. A + is now reserved to

Re: +$arg changed to :$arg

2005-10-26 Thread Matt Fowles
Larry~ On 10/26/05, Larry Wall [EMAIL PROTECTED] wrote: So we'd get: :@array[42] 42 = @array[1] Do you mean C :@array[42] 42 = @array[42] ? The last three forms are more arguable than the first three, especially since they probably aren't valid formal parameters. We kind of need a

Re: new sigil

2005-10-26 Thread Larry Wall
On Tue, Oct 25, 2005 at 10:25:48PM -0600, Luke Palmer wrote: : Yeah, I didn't really follow his argument on that one. I, too, think : that the one() junction in general is silly, especially for types. Well, I think it's silly too. I'm just trying to see if we need to reserve the syntax in case

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 10:06:25AM -0400, Matt Fowles wrote: : Larry~ : : On 10/26/05, Larry Wall [EMAIL PROTECTED] wrote: : So we'd get: : : :@array[42] 42 = @array[1] : : Do you mean C :@array[42] 42 = @array[42] ? Yes. I was changing it because 42 : 1 :: foo : a, but I flubbed. :

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 04:02:06PM +0200, Juerd wrote: : Larry Wall skribis 2005-10-26 6:44 (-0700): : I should point out that one of the major changes in the most recent : S6 is that named arguments are now marked by : rather than +, with : :foo($bar) being the way to declare parameter $bar

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
It also means you could write a prototype that looks like :(!, !, !, ?, ?) We don't need no stinkin' _. There's more than one way to not care. (I guess that means that in addition to supporting interesting values of undef, we also support interesting values of not caring...) But does that

Re: +$arg changed to :$arg

2005-10-26 Thread John Siracusa
On 10/26/05, Larry Wall [EMAIL PROTECTED] wrote: A mandatory named parameter is now marked +:$nonoptionaloption. Woo! :) -John

Re: +$arg changed to :$arg

2005-10-26 Thread Juerd
Larry Wall skribis 2005-10-26 7:31 (-0700): One slightly serious ramification of the : switch is that the space is required after the colon indicating a null invocant. method doit (: $a, $b, $c) Or, we could separate it with a . instead of a :, perhaps? This is already more or less very

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Tue, Oct 25, 2005 at 05:17:40PM -0400, Stevan Little wrote: : Larry, : : On Oct 25, 2005, at 4:37 PM, Larry Wall wrote: : On Mon, Oct 24, 2005 at 06:33:20AM -0700, Ashley Winters wrote: : : # behavior through prototype -- guessing realistic syntax : : Base.meta.add_method( : : do_it =

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 04:59:04PM +0200, Juerd wrote: : Larry Wall skribis 2005-10-26 7:31 (-0700): : One slightly serious ramification of the : switch is that the space : is required after the colon indicating a null invocant. : method doit (: $a, $b, $c) : : Or, we could separate it

Re: Ways to add behavior

2005-10-26 Thread Rob Kinyon
That's just self.meta.add_method($label, $method) by my lights. A .meta already implies/ignores the .class coercion. If we are to support prototype-based programming $x.meta *must not care* whether it has been given a class or an instance or something in between. What I am calling a class

Re: +$arg changed to :$arg

2005-10-26 Thread Juerd
Larry Wall skribis 2005-10-26 8:29 (-0700): I think a . would be too lightweight visually within the signature. Plus . is a postfix prefix syntactically, not a delimiter. If weight is the issue, @#@ should do ;) This aside, you could of course just double the colon. Or use a semicolon. I

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 11:31:28AM -0400, Rob Kinyon wrote: : That's just self.meta.add_method($label, $method) by my lights. : A .meta already implies/ignores the .class coercion. If we are to : support prototype-based programming $x.meta *must not care* whether : it has been given a class

Re: Ways to add behavior

2005-10-26 Thread Austin Frank
Larry Wall wrote: Of course, there are other words that are somewhat synonymous with class, Unfortunately sort is already hosed. Maybe kind. Then evolutionists could make jokes about the K(T) boundary, and creationists could make jokes about reproducing after their kind. Some of us could make

Re: Ways to add behavior

2005-10-26 Thread Stevan Little
On Oct 26, 2005, at 12:05 PM, Larry Wall wrote: Of course, there are other words that are somewhat synonymous with class, Unfortunately sort is already hosed. Maybe kind. Actually kind is used in the Core Calculus for Metaclasses paper which I brought to the hackathon (not sure if you got

Re: Ways to add behavior

2005-10-26 Thread Jonathan Scott Duff
On Wed, Oct 26, 2005 at 09:05:22AM -0700, Larry Wall wrote: Of course, there are other words that are somewhat synonymous with class, Unfortunately sort is already hosed. Maybe kind. Maybe we could go with something Linnaean like family or genus even though their relation to class isn't quite

Re: Ways to add behavior

2005-10-26 Thread Ruud H.G. van Tol
Larry Wall: But perhaps it wouldn't be kind. 'caste' wouldn't either. For inspiraton: type sort class variety brand category breed manner style nature form hue caste set background stage setting milieu locale range assortment selection mixture strain suite scenery rank grade division status

Re: Ways to add behavior

2005-10-26 Thread Rob Kinyon
On 10/26/05, Stevan Little [EMAIL PROTECTED] wrote: On Oct 26, 2005, at 12:05 PM, Larry Wall wrote: Of course, there are other words that are somewhat synonymous with class, Unfortunately sort is already hosed. Maybe kind. Actually kind is used in the Core Calculus for Metaclasses paper

Re: Ways to add behavior

2005-10-26 Thread Ruud H.G. van Tol
Stevan Little: They present an rather interesting view on things, that the definition of the instance creating portion of a class should be seperated from the class or kind portion of the class. Its quality. Its character. Its features. Its face. -- Grtz, Ruud

Re: +$arg changed to :$arg

2005-10-26 Thread TSa
HaloO, Larry Wall wrote: On Wed, Oct 26, 2005 at 04:59:04PM +0200, Juerd wrote: : Larry Wall skribis 2005-10-26 7:31 (-0700): : One slightly serious ramification of the : switch is that the space : is required after the colon indicating a null invocant. What is an invocantless method other

Re: Ways to add behavior

2005-10-26 Thread Brent 'Dax' Royal-Gordon
Larry Wall [EMAIL PROTECTED] wrote: Of course, there are other words that are somewhat synonymous with class, Unfortunately sort is already hosed. Maybe kind. Then evolutionists could make jokes about the K(T) boundary, and creationists could make jokes about reproducing after their kind.

Re: Ways to add behavior

2005-10-26 Thread TSa
HaloO, Austin Frank wrote: Which (sort of) takes us back to TSa's (non)sign-off note from 10/5, wherein he suggested: I just can't help it, I love the good work done on this list! And thanks for spelling the acronym correctly. The Kindly One of a class beeing the representative like the

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 12:22:07PM -0400, Stevan Little wrote: : : On Oct 26, 2005, at 12:05 PM, Larry Wall wrote: : Of course, there are other words that are somewhat synonymous with : class, Unfortunately sort is already hosed. Maybe kind. : : Actually kind is used in the Core Calculus for

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 07:06:15PM +0200, TSa wrote: : HaloO, : : Larry Wall wrote: : On Wed, Oct 26, 2005 at 04:59:04PM +0200, Juerd wrote: : : Larry Wall skribis 2005-10-26 7:31 (-0700): : : One slightly serious ramification of the : switch is that the space : : is required after the colon

Re: Ways to add behavior

2005-10-26 Thread Uri Guttman
LW == Larry Wall [EMAIL PROTECTED] writes: LW One wants to coin a word like Qlass. Unfortunately qlass is LW too easy to misread as glass. Oy veh, I'm getting notions of LW the qlass is half empty for a partially instantiated object. [EMAIL PROTECTED], i think you need some immediate

Re: Ways to add behavior

2005-10-26 Thread Rob Kinyon
So maybe we can define our terms like this: type: a completely generic metaterm for any of the following, and then some. class: a mutable interface object that manages instances in the classical way, with covariant derivational properties. role: an immutable and

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 03:54:35PM -0400, Rob Kinyon wrote: : So maybe we can define our terms like this: : : type: a completely generic metaterm for any of the following, : and then some. : : class: a mutable interface object that manages instances in the : classical way,

Re: Ways to add behavior

2005-10-26 Thread Luke Palmer
On 10/26/05, Larry Wall [EMAIL PROTECTED] wrote: So maybe we can define our terms like this: type: a completely generic metaterm for any of the following, and then some. class: a mutable interface object that manages instances in the classical way, with covariant

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

2005-10-26 Thread Rob Kinyon
: 3) Aren't classes mutable and roles immutable by default only? Or has : this changed? Of course. To change the default for a role, call it a class, and to change the default for a class, call it a role. :-) Does this mean that roles are the recommended way to create immutable classes?

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

2005-10-26 Thread chromatic
On Wed, 2005-10-26 at 20:29 -0400, Rob Kinyon wrote: I would prefer to use roles as they're closed by default, leaving class to be my powertool, if I need the power. I don't understand this desire; can you explain your reasoning? (NB: closed here, as I use it, still *does not* correspond to

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

2005-10-26 Thread Rob Kinyon
On 10/26/05, chromatic [EMAIL PROTECTED] wrote: On Wed, 2005-10-26 at 20:29 -0400, Rob Kinyon wrote: I would prefer to use roles as they're closed by default, leaving class to be my powertool, if I need the power. I don't understand this desire; can you explain your reasoning? If a role

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

2005-10-26 Thread Luke Palmer
On 10/26/05, Rob Kinyon [EMAIL PROTECTED] wrote: On 10/26/05, chromatic [EMAIL PROTECTED] wrote: On Wed, 2005-10-26 at 20:29 -0400, Rob Kinyon wrote: I would prefer to use roles as they're closed by default, leaving class to be my powertool, if I need the power. I don't understand

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

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 08:48:12PM -0400, Rob Kinyon wrote: : If a role is an immutable class, that means that its internals cannot : be changed. Hence, the compiler can trust that it will be the same at : the end as at the beginning. Which means it's optimized. Which means : my objects run faster

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 04:56:23PM -0600, Luke Palmer wrote: : Then ^T $x binds T to the kind of $x. And $x.kind == $y.kind asks : if two objects are of the same type, : : Don't you mean $x.kind eqv $y.kind? : : Ugh. Now that infix::: has come available, maybe I mean: $x.kind :: $y.kind

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 06:34:48PM -0700, Larry Wall wrote: : On Wed, Oct 26, 2005 at 04:56:23PM -0600, Luke Palmer wrote: : : Then ^T $x binds T to the kind of $x. And $x.kind == $y.kind asks : : if two objects are of the same type, : : : : Don't you mean $x.kind eqv $y.kind? : : : : Ugh. :

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

2005-10-26 Thread chromatic
On Wed, 2005-10-26 at 19:22 -0600, Luke Palmer wrote: But we find that many programmers make decisions that trade readability and extensibility for an extra 1% of speed, even when they are writing a command-line frontend to MPlayer[1]. If those people are module writers, then we have a bunch

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

2005-10-26 Thread Rob Kinyon
On 10/26/05, Luke Palmer [EMAIL PROTECTED] wrote: [snip] Okay, an open class means you can add methods to it, right? So, let's say you have this class: class Foo { method foo() {...} method bar() {...} } And this code: my Foo $x = Foo.new; $x.foo();

Re: Ways to add behavior

2005-10-26 Thread chromatic
On Wed, 2005-10-26 at 14:52 -0400, Uri Guttman wrote: LW == Larry Wall [EMAIL PROTECTED] writes: LW One wants to coin a word like Qlass. Unfortunately qlass is LW too easy to misread as glass. Oy veh, I'm getting notions of LW the qlass is half empty for a partially instantiated

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

2005-10-26 Thread chromatic
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 would do: class My::Version { does Some::Class; } Problem solved. Don't forget the fun of modifying all existing uses of

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

2005-10-26 Thread Larry Wall
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 would do: : : class My::Version { : does Some::Class; :

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

2005-10-26 Thread Luke Palmer
On 10/26/05, Rob Kinyon [EMAIL PROTECTED] wrote: What about: class Foo is also { method foo() { ... } } Where the second foo() is no longer what the first foo() did. Just overwrite the vtable. Furthermore, let's say you have: class Bar isa Foo { method

Re: $1 change issues [was Re: syntax for accessing multiple versions of a module]

2005-10-26 Thread chromatic
On Thu, 2005-10-20 at 17:12 -0700, Nate Wiger wrote: If Perl 6 is going to be successful, this means it must change the fewest key things with the most benefits. I think there's an assumption here that not only do I not hold but I do not even understand. Suppose that I am a game developer