I've been mucking about a bit more with this whole interface thing.
So if we make method signatures only enforced on subclasses if the parent
class or method has the interface property...
except private methods, obviously.
And if we make pre/post conditions and class invariants always
On Thu, Oct 03, 2002 at 02:46:38PM -0400, Michael G Schwern wrote:
class ATV is Car, interface {
Hmmm. That should probably be
class ATV isa Car is interface {
--
Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/
Perl Quality Assurance [EMAIL
I've been mucking about a bit more with this whole interface thing.
So if we make method signatures only enforced on subclasses if the parent
class or method has the interface property...
except private methods, obviously.
And if we make pre/post conditions and class invariants always
On Thu, Oct 03, 2002 at 03:00:21PM -0400, Michael G Schwern wrote:
On Thu, Oct 03, 2002 at 02:46:38PM -0400, Michael G Schwern wrote:
class ATV is Car, interface {
Hmmm. That should probably be
class ATV isa Car is interface {
That's:
class ATV is Car is interface {
On Thu, Oct 03, 2002 at 03:45:33PM -0500, Allison Randal wrote:
On Thu, Oct 03, 2002 at 03:00:21PM -0400, Michael G Schwern wrote:
On Thu, Oct 03, 2002 at 02:46:38PM -0400, Michael G Schwern wrote:
class ATV is Car, interface {
Hmmm. That should probably be
class ATV
On Thu, Oct 03, 2002 at 03:59:08PM -0400, Mike Lambert wrote:
With pre/post conditions, a subclass is allowed to weaken the
preconditions or strengthen the postconditions.
How exactly does one weaken a precondition?
--
Michael G. Schwern [EMAIL PROTECTED]
Makes sense, no?
I like that quite a lot.
One question I still have is the syntax of pre/post conditions, e.g:
method turn($direction, $how_sharp) {
pre { $how_sharp = 20 } is private;
...implementation...
}
This is obviously
In a message dated Thu, 3 Oct 2002, Michael G Schwern writes:
On Thu, Oct 03, 2002 at 03:59:08PM -0400, Mike Lambert wrote:
With pre/post conditions, a subclass is allowed to weaken the
preconditions or strengthen the postconditions.
How exactly does one weaken a precondition?
You weaken
On Thu, Oct 03, 2002 at 05:14:22PM -0400, Michael G Schwern wrote:
On Thu, Oct 03, 2002 at 03:45:33PM -0500, Allison Randal wrote:
On Thu, Oct 03, 2002 at 03:00:21PM -0400, Michael G Schwern wrote:
On Thu, Oct 03, 2002 at 02:46:38PM -0400, Michael G Schwern wrote:
class ATV is Car,
Michael G Schwern:
I've been mucking about a bit more with this whole interface thing.
So if we make method signatures only enforced on subclasses
if the parent class or method has the interface property...
except private methods, obviously.
And if we make pre/post conditions
In a message dated Thu, 3 Oct 2002, Allison Randal writes:
So far, classes are uppercase and properties are lowercase, but that's
convention, not law.
Do runtime (value) properties and compile-time (variable) properties share
the same namespace?
That is, to go back to an earlier discussion,
Garrett Goebel:
Michael G Schwern:
But I don't want my subclasses to be constrained by that.
It's just an implementation detail that I only wish to
enforce upon ATV and not it's children.
implementation details don't belong in interfaces
On Thu, Oct 03, 2002 at 02:29:57PM -0700, Michael Lazzaro wrote:
(As a lame aside, are we going to have a concept of private vs.
protected vs. public, or just private/public?
No protected. Even Stroustrup admits it was a mistake in DE.
--
Paul Johnson - [EMAIL PROTECTED]
On Thu, Oct 03, 2002 at 02:29:57PM -0700, Michael Lazzaro wrote:
One question I still have is the syntax of pre/post conditions, e.g:
method turn($direction, $how_sharp) {
pre { $how_sharp = 20 } is private;
...implementation...
}
On Thu, Oct 03, 2002 at 04:54:13PM -0500, Garrett Goebel wrote:
Garrett Goebel:
Michael G Schwern:
But I don't want my subclasses to be constrained by that.
It's just an implementation detail that I only wish to
enforce upon ATV and not it's children.
implementation details don't
On Thu, Oct 03, 2002 at 05:23:08PM -0500, Jonathan Scott Duff wrote:
I don't know, but I think it's supposed to be like this:
# part of the signature
method turn($dir,$ang) is pre { $ang = 20 } {
...
}
# part of the implementation
method
On Thu, Oct 03, 2002 at 02:29:57PM -0700, Michael Lazzaro wrote:
Do you think it's sufficiently clear to newbies that the pre { } is
associated with the signature of the turn() interface method, and not
just the _implementation_ of turn() in Vehicle?
The rule would be pretty simple to teach
On Thu, Oct 03, 2002 at 05:30:49PM -0400, Trey Harris wrote:
In a message dated Thu, 3 Oct 2002, Michael G Schwern writes:
On Thu, Oct 03, 2002 at 03:59:08PM -0400, Mike Lambert wrote:
With pre/post conditions, a subclass is allowed to weaken the
preconditions or strengthen the
On Thursday, October 3, 2002, at 03:18 PM, Paul Johnson wrote:
(As a lame aside, are we going to have a concept of private vs.
protected vs. public, or just private/public?
No protected. Even Stroustrup admits it was a mistake in DE.
Oh, thank God. I was hoping people would say that.
OK,
Michael G Schwern:
On Thu, Oct 03, 2002 at 05:30:49PM -0400, Trey Harris wrote:
In a message dated Thu, 3 Oct 2002, Michael G Schwern writes:
On Thu, Oct 03, 2002 at 03:59:08PM -0400, Mike Lambert wrote:
With pre/post conditions, a subclass is allowed to weaken the
preconditions
On Thu, Oct 03, 2002 at 04:47:26PM -0500, Garrett Goebel wrote:
And if we make pre/post conditions and class invariants
always enforced...
no.
post-conditions and invariants are always enforced, but pre-conditions are
different.
Right, right.
A derived interface can loosen input
On Thu, Oct 03, 2002 at 06:46:14PM -0400, Michael G Schwern wrote:
I see us already smashing too many things into the method signature as it
is. It will rapidly get messy if you have a method with a complex signature
and a handful of attributes and preconditions.
I think I have my own
On Thursday, October 3, 2002, at 04:25 PM, Michael G Schwern wrote:
On Thu, Oct 03, 2002 at 03:54:09PM -0700, Michael Lazzaro wrote:
I have no *good* syntax proposals for this, I don't think I've ever
seen the problem solved with syntax that I really ever liked.
On Thu, 3 Oct 2002, Michael Lazzaro wrote:
1) Delegation through inheritance:
(a.k.a. mixin classes, hard delegation, concrete interfaces,
etc., etc.)
Example: I want to say that a class DataManager has the capabilities
of the interfaces DataStrategy and CacheStrategy,
On Thu, 3 Oct 2002, Trey Harris wrote:
Incidentally, has there been any headway made on how you DO access
multiple classes with the same name, since Larry has (indirectly) promised
us that? I.e., I import two classes LinkedList and BTree, both of
which define a Node class?
Hopefully,
In a message dated Thu, 3 Oct 2002, John Williams writes:
On Thu, 3 Oct 2002, Trey Harris wrote:
Incidentally, has there been any headway made on how you DO access
multiple classes with the same name, since Larry has (indirectly) promised
us that? I.e., I import two classes LinkedList
In a message dated Thu, 3 Oct 2002, Michael Lazzaro writes:
On Thursday, October 3, 2002, at 04:25 PM, Michael G Schwern wrote:
Class::Delegation?
Yeah, it's one of the best I've seen: it makes sense, does everything I
want, and is easy to explain even to newbies. The perl5 hash-based
On Thu, Oct 03, 2002 at 07:59:33PM -0600, John Williams wrote:
Reaction #2: Inheritance would automatically delegate all those
methods, so again, in what way does inheritance _not_ solve the problem?
I don't think p6l is the right place to discuss the merits of delegation,
let's just say it's
On Fri, Oct 04, 2002 at 12:28:29AM -0400, Trey Harris wrote:
I think my point here is that there are clearly places where we need
stronger built-in support in Perl of some OO concepts. Delegation may not
be one of them--it's easy enough to graft on, and TMTOWTDI may be good
here.
Delegation
Michael G Schwern wrote:
How exactly does one weaken a precondition?
Say I define a mathematical mod() function in my parent number class.
precondition: $a 0, $b 0, $b is int
mod( $a, $b )
Then in my subclass, I want to make it work in a wider variety of
contexts. I change the definition
In a message dated Thu, 3 Oct 2002, Garrett Goebel writes:
Michael G Schwern:
On Thu, Oct 03, 2002 at 05:30:49PM -0400, Trey Harris wrote:
In a message dated Thu, 3 Oct 2002, Michael G Schwern writes:
On Thu, Oct 03, 2002 at 03:59:08PM -0400, Mike Lambert wrote:
With pre/post
31 matches
Mail list logo