[Gambas-user] How to stop "Greedy" constructors consuming parameters

Ian Haywood ihaywood at ...1979...
Tue Apr 30 05:05:06 CEST 2013


On 30/04/13 00:34, Benoît Minisini wrote:

> If theses twwo arguments must be handled differently between classes, 
> then add a public method to handle them. Prefix its name with an 
> underscore, to indicate that it must not be called outside of the 
> implementation.
> 
> ' Root class
> Public Sub _new(Source as String[], Name as String)
>    _Init(Source, Name)
> End
> 
> ' Any child class
> Public Sub _Init(Source as String[], Name as String)
This is rule around underscores enforced by the compiler (a la Python)
or only a convention?

would you consider a Protected access type (like C++) instead?

Ian




More information about the User mailing list