[fpc-pascal] Free Pascal Directories
Marco van de Voort
marcov at stack.nl
Fri Oct 3 10:46:32 CEST 2014
In our previous episode, silvioprog said:
> > >[...]
> > > But it would be an nice feature in Free Pascal, something like the
> > "import"
> > > of Python and Java. =)
> >
> > Java requires a CLASSPATH for the imports to work, does it not?
>
> You can import one or more classes. E.g, you can use it:
>
> import com.example.Foo;
> import com.example.Bar;
>
> or:
>
> import com.example.*;
>
> In first example, you import only Foo and Bar classes, in second you import
> any classes in "example", Foo, Bar, Other.
I think Mattias meant that Java still needs to pass paths outside the
source. So the hierarchical system of Java only fixes recursion, not all
paths.
And it adds the limitation that if you move a class from one namespace to
the other, you need to adapt all applications. In that, the concept is very
rigid compared to FPC units directories.
More information about the fpc-pascal
mailing list