Poll: Given the following files:
A.pmod: void foo() { werror("A\n"); }
class B { void bar() { foo(); } }
C.pike:
inherit .A.B;
void baz() { foo(); }
void foo() { werror("C\n"); }
Should the following program:
int main() { object c = .C();
c->bar(); c->baz(); }
Output
A C
or
C C
? ie Should parent references be overloadable via inherit?
My opinion: Don't overload parent references.
/ Per Hedbor ()
Previous text:
2003-01-22 14:31: Subject: Parent reference semantics.
Poll: Given the following files:
A.pmod: void foo() { werror("A\n"); }
class B { void bar() { foo(); } }
C.pike:
inherit .A.B;
void baz() { foo(); }
void foo() { werror("C\n"); }
Should the following program:
int main() { object c = .C();
c->bar(); c->baz(); }
Output
A C
or
C C
? ie Should parent references be overloadable via inherit?
/ Henrik Grubbström (Lysator)
I vote A, C. Only methods can be overloaded.
/ Niels Möller ()
Previous text:
2003-01-22 14:31: Subject: Parent reference semantics.
Poll: Given the following files:
A.pmod: void foo() { werror("A\n"); }
class B { void bar() { foo(); } }
C.pike:
inherit .A.B;
void baz() { foo(); }
void foo() { werror("C\n"); }
Should the following program:
int main() { object c = .C();
c->bar(); c->baz(); }
Output
A C
or
C C
? ie Should parent references be overloadable via inherit?
/ Henrik Grubbström (Lysator)
A,C. bar() is not an identifier in A.B, so of course it can't be overloaded by a child class of A.B.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-01-22 14:31: Subject: Parent reference semantics.
Poll: Given the following files:
A.pmod: void foo() { werror("A\n"); }
class B { void bar() { foo(); } }
C.pike:
inherit .A.B;
void baz() { foo(); }
void foo() { werror("C\n"); }
Should the following program:
int main() { object c = .C();
c->bar(); c->baz(); }
Output
A C
or
C C
? ie Should parent references be overloadable via inherit?
/ Henrik Grubbström (Lysator)
Can you give an example where one could reasonable expect or make reasonablec use of the "C C" behaviour?
/ Niels Möller ()
Previous text:
2003-01-22 14:31: Subject: Parent reference semantics.
Poll: Given the following files:
A.pmod: void foo() { werror("A\n"); }
class B { void bar() { foo(); } }
C.pike:
inherit .A.B;
void baz() { foo(); }
void foo() { werror("C\n"); }
Should the following program:
int main() { object c = .C();
c->bar(); c->baz(); }
Output
A C
or
C C
? ie Should parent references be overloadable via inherit?
/ Henrik Grubbström (Lysator)
No. A, C.
/ Leif Stensson, Lysator
Previous text:
2003-01-22 14:31: Subject: Parent reference semantics.
Poll: Given the following files:
A.pmod: void foo() { werror("A\n"); }
class B { void bar() { foo(); } }
C.pike:
inherit .A.B;
void baz() { foo(); }
void foo() { werror("C\n"); }
Should the following program:
int main() { object c = .C();
c->bar(); c->baz(); }
Output
A C
or
C C
? ie Should parent references be overloadable via inherit?
/ Henrik Grubbström (Lysator)
You already know, but I vote C C too.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-01-22 14:31: Subject: Parent reference semantics.
Poll: Given the following files:
A.pmod: void foo() { werror("A\n"); }
class B { void bar() { foo(); } }
C.pike:
inherit .A.B;
void baz() { foo(); }
void foo() { werror("C\n"); }
Should the following program:
int main() { object c = .C();
c->bar(); c->baz(); }
Output
A C
or
C C
? ie Should parent references be overloadable via inherit?
/ Henrik Grubbström (Lysator)
pike-devel@lists.lysator.liu.se