[Gambas-user] Idea for 3.17

Bruce adamnt42 at gmail.com
Sun May 9 04:17:30 CEST 2021


On 9/5/21 3:15 am, Christof Thalhofer wrote
SNIP)

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

It's not "confusing" but as I said originally it's not that simple. All 
your example addresses is the case of a local variable.  Consider all 
the declarations in the Gambas language where the specific Orm would 
need to be stated ...

' Gambas class file
Inherits <ns>Orm
Event Whatever(AnOrm as <ns>Orm)
Class <ns>Orm
Public/Private MyOrm as <ns>Orm
Public/Private LotsOfOrms as <ns>Orm[]
Property ThisOrm as <ns>Orm
Sub DoSomething(OrmThingy as <ns>Orm)
Function WhichOrm() as <ns>Orm
others?

where <ns> is the namespace specifier, how ever it is going to be 
implemented... colon delimiters, bang delimiters, whatever.

Or we could end up with a different syntax in each case?


' Gambas class file
Inherits Orm From <ns>.
Event Whatever(AnOrm as [Orm in <ns>] )
Class <ns>Orm
Public/Private MyOrm as Orm Using <ns>
etc.

(Note: This is all a discussion point, not an argument for or against 
namespacing.)

b


More information about the User mailing list