On Wed, 13 Sep 2017 14:38:55 +0200 Sven Barth via Lazarus <lazarus@lists.lazarus-ide.org> wrote:
>[...] > I'm not talking about ambiguity, I'm talking about aesthetics: FooBar.Blubb > is easier to discern visually than FooBarBlubb. Well, aesthetics often goes together with "used to". I'm used to a point separates a sub identifier. The Delphi namespace concept breaks this rule. E.g. in a namespace "org.fpc" the dot is part of the identifier. Try "org.|" with the Delphi code insight. It does not show all possibilities. Lazarus code completion works better here. > Also were is there an ambiguity anyway (given all units are used with their > full name)? The compiler reads (in my above example) the token sequence ID > Point ID and thus can find the unit without any backtracking just as for > ordinary methods. Even once the default namespace option is added that > won't change as the compiler will simply test all provided namespaces as > prefixes and then the name as is. It's just a longer list of names than > usually to test for. Let's say you have 'a.b.c.d'. Before namespaces the compiler could simply resolve a, then b, then c and finally d. With namespaces the compiler has to read the full 'a.b.c.d', then search for a.b.c, then a.b, then a and then resolve the rest as before. For example: program unitdots.main1: uses unitdots.unit1, unitdots; type TPrgBright = unitdots.tbright; TPrgColor = unitdots.unit1.tcolor; TStrange = unitdots.main1.tprgcolor; var k1: longint; begin if unitdots.main1.k1=0 then ; if unitdots.j1=0 then ; if unitdots.unit1.i1=0 then ; Mattias -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus