[fpc-devel] New FPC target: JVM

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Aug 21 10:33:41 CEST 2011

On 21 Aug 2011, at 05:03, Paul Ishenin wrote:

> Sad that "units with dots" feature was blocked previosly - it would allow you to write java classes as is with namespace prefix instead of use abbrevations.

I don't think that would be usable, unless we'd also allow something like Java's "import java.xml.*" or propagating uses. There are classes from 216 different packages in the jdk15 unit, so you could easily get enormous uses clauses without such a feature. I'm also not sure how it would work for the classes that are required in the system unit, since the system unit cannot depend on other units (even if it could for one special unit, that other unit would require system unit types such as "jint" or even "longint"). Even importing them under a different name wouldn't work, since e.g. TObject is derived from java.lang.Object and the compiler should allow you to typecast these types to each other. But if you have a type called "Object" in a unit called "java.lang" and a separate type "JLObject" from which TObject derives in the system unit, that wouldn't work.

And dotted unit names would still introduce the ambiguities that caused the feature to be blocked.


More information about the fpc-devel mailing list