Jonathan Daugherty <[EMAIL PROTECTED]> wrote:

> # enforced by whom, at what point ?
> 
> In the case of Java, I think the JVM enforces interface implementation
> (probably at the parser level).

"parser"...?!  If you have an 'Object o', say one just received as an
argument, and cast it to IBlahble, a la

    IBlahble blah = (IBlahble) o;

...what can the parser ever say about it?  It's clearly up to the
runtime system to "enforce" whatever -- raising the appropriate
exception if the "actual" (leafmost) class of o does not in fact
implement IBlahble (Java doesn't _really_ do compile-time static typing:
it just forces you to violate the "Don't Repeat Yourself" cardinal rule
by redundantly repeating types, as above, but then in general it checks
things at runtime anyway!).


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to