[Gambas-user] Idea for 3.17

Christof Thalhofer chrisml at deganius.de
Sat May 8 19:45:09 CEST 2021


Am 08.05.21 um 14:47 schrieb Bruce:

> @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.

I still don't understand what you mean with BEFORE.

But let's look how namespaces could be handled in code:

Maybe we can do sth like:

'Use ... As ...'.*

(Or we have another way to import a library into a project together with
an alias, maybe in the Project Dialog which stores that in the
'.project' file).

Imagine a library called 'de.deganius.db'. It containes one class: 'Orm'.

You want to use it inside your project. As it happens, your project also
contains a class 'Orm'.

Let us look at a piece of (imaginated) code:

--------------------------------------------------------
Public Sub Main()

    Use de.deganius.db As Degdb

    Dim DegOrm as New Dgdb.Orm
    Dim MyOrm as New Orm

    DegOrm.DoSomething(DegOrm.ConstantA)
    MyOrm.DoSomethingOther()

End
--------------------------------------------------------

What would be confusing with that? Why wouldn't it be backwards
compatible? If you remove the lines which have to do with namespaces
everything is just as before (aka runs in current Gambas).

Alles Gute

Christof Thalhofer

* Like in PHP

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210508/3dd201ef/attachment.sig>


More information about the User mailing list