On Sat, Oct 14, 2017 at 1:18 AM, leledumbo via Lazarus <[email protected]> wrote: >> Is it not possible *today* or never? > > Never, not without changing the way compiler manages units. FPC units are > organized in folders for easier management at filesystem level, but > filesystem is not the namespace, there can never be /first/path/to/a.pas and > /second/path/to/a.pas used in a single program, because only that a > identifies the unit, not the path to it. This is the same as you can't have > two files with the same name under the same path. Indeed you can't control > unit names written by 3rd party and collision might happen, so most package > developers add prefix in their unit names (e.g. IdGlobals) or use the new > dotted unit names (e.g. my.globals.types, your.globals.consts). > >> So, the main program shouldn't know nothing about "private units" that >> belongs only for the package. That is encapsulation too. > > Pascal unit is THE namespace, while most other languages uses filesystem as > namespace. Namespace don't have visibility, only its contents have.
I know how it works in a single program, but I thought that using packages could be different... but not. Thanks, anyway. Best regards, Marcos Douglas -- _______________________________________________ Lazarus mailing list [email protected] https://lists.lazarus-ide.org/listinfo/lazarus
