[Gambas-user] Idea for 3.17

Bruce adamnt42 at gmail.com
Sat May 8 14:47:46 CEST 2021


On 8/5/21 6:12 pm, Christof Thalhofer wrote:
> Am 08.05.21 um 00:37 I wrote:
> 
>> The Java folks recommend that companies name their packages according to
>> their domain names, just the other way round:
>>
>> 'com.example.mypackage'
> 
> And they use the package names for importing classes:
> 
> http://www.btechsmartclass.com/java/java-importing-packages.html
> 
> 'Import com.example.mypackage.*'
> 
> or
> 
> 'Import com.example.mypackage.JustOneClass'
> 
> So ... if we take Java as an example, we would have to allow dots in the
> names. Both for the names of libraries, as well as for namespaces.
> 
> That's what I would ask for.
> 
> Alles Gute
> 
> Christof Thalhofer
> 
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 
Christof,
That is confusing.

Package naming and internal syntax are two entirely different things. 
Even so, java package naming i a PITA and furthermore so is the syntax.

Well, OK maybe package naming is not THAT confusing just painful. Using 
domain name backwards is a wonderful idea, jicht wah?

And that is why I said that the syntax inside java is just a very good 
reason to not adopt it.

But we are still discussing what namespacing syntactically means within 
Gambas I hope.

@Brian: It is NOT simple. It is easy to say "Oh, just add a namespace in 
front of 9notice that I eschewed the word "before") some declaration. I 
have already posted the number of places that this would be required. 
And I'll add another to that list ... Inherits

Namespacing while retaining so called "backward compatibility" just 
cannont work! The crux being (yet again) the compiler has absolutely no 
idea of what the project configuration was BEFORE (in terms of 5 minutes 
ago), so any ideas that existing code could be differentiated between 
"what is" and "what was" are impossible.

BTW: I see some come conflict in what you (Brian) said about testing 
component loading and wht I understand. My reading of the whole mess is:
- The pseudo-component "gb" is the first to be loaded as it is part of 
the runtime.
- The current project is the LAST to be loaded,as per the Object Model" 
help. Otherwise the current architecture could npt work.
- In between those two component loading is more or less indetermenent, 
as it depends??? on component Requires and Needs. I think, sort of.

- Explicit loading would occur after the project load, but how and when 
is magic understood only by magicians such as BM and FB.

Finally, here's a joke...
Project uses component "FredA"
New component is introduced "Fredb"
Both contain a class called "NoMailn
The programmer adds the "Fredb" component and her project now crashes 
due to name collisions.
She removes the "FredA" component, the projec now crashes due to 
signature errors.
Her co-programmer re-adds "FredA"
Back to namespace collissions, gbc3 now says "FIIK" what was before?

Punchline: It's a bit like the AeroTrain.

Guys, I hope this all translates.

@Christof. Well, you did want discussion! :-)

regards
bruce



More information about the User mailing list