> >>
> >>>Just to get you up to speed, the current issue is about multiple
> >>>inheritance, and how the current system allows cross-import (unwanted?)
> >>>side-effects, as Conor has brilliantly shown.
> >>
> >> What I'm not sure I understand is what import has to do with multiple
> >> inheritance :-)
> >
> > Because we can import two targets with the same name from different
> > files. Making them work together is conceptually similar.
>
> You could try to import 2 classes with the same name in java.
> It's a syntax error - and if it happen, you must use qualified names.
>
> Yes, most build files have a target named "build" - but I don't know why
> would you think about inheritance and OO instead of just qualified names.
>
> I don't know _any_ programming language where import is used for
> inheritance.
>

Maybe it would be better to think in the term of "mixin" as some languages
(e.g. some Lisp flavours and Ruby) use.  The following two exerpts are from
the Modules chapter of the free book "Programming Ruby: The Pragmatic
Programmer's Guide" (http://www.rubycentral.com/book/tut_modules.html):

 o Modules are a way of grouping together methods, classes, and constants.
Modules give you two major benefits:
   1. Modules provide a namespace and prevent name clashes.
   2. Modules implement the mixin facility.
 o Modules have another, wonderful use. At a stroke, they pretty much
eliminate the need for multiple inheritance, providing a facility called a
'mixin'.

Ruby uses an "include" statement (not "import") to "mix in" another module.
And as such the included modules effectively behave as superclasses.

Maybe it would be possible to borrow some ideas and concepts from Ruby...

--
knut




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to