|
"inheritance" order in Perl proxies: msg#00117programming.swig
The Perl proxy classes pseudo-inherit from the module they're in, e.g.: package example::Circle; @ISA = qw( example example::Shape ); Because the module comes first, a global function takes precedence over a method defined in a superclass. If there's a global function Foo, and also a method Shape::Foo, a user who writes $cir = new example::Circle(3.7); $cir->Foo(); will probably expect to get Shape::Foo, but will get the global Foo instead. I can remedy this by switching the order of the "base classes": package example::Circle; @ISA = qw( example::Shape example ); Is there a reason not do it this way? Josh -- Joshua L. Cherry, Ph.D. NCBI/NLM/NIH (Contractor) jcherry@xxxxxxxxxxxxxxxx _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: typenames.i, double * and python: 00117, Marcelo Matus |
|---|---|
| Next by Date: | Simple .i files.: 00117, Jake Janovetz |
| Previous by Thread: | FW:i: 00117, Devender Marri |
| Next by Thread: | Re: "inheritance" order in Perl proxies: 00117, Jason E. Stewart |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |