<div dir="ltr">Thank you. All is more clear for me now.<div><br></div><div>However, I'm facing an issue that I'm not sure how to handle it.</div><div><br></div><div>I have a basic class with a method:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">Public Function doSomething(param as SomeBaseClass) as String</font></div><div><font face="courier new, monospace">  ' Some stuff</font></div><div><font face="courier new, monospace">End</font></div></blockquote><div><br></div><div>And a derivated class that I need to call some specialized method</div><div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="courier new, monospace">Public Function doSomething(param as SomeDerivatedClass) as String</font></div></div><div><div><font face="courier new, monospace">  ' Some stuff</font></div></div><div><div><font face="courier new, monospace">  param.childMethod()</font></div></div><div><div><font face="courier new, monospace">  ' More stuff</font></div></div><div><div><font face="courier new, monospace">End</font></div></div></blockquote><div><br></div><div>But this rise "Symbol is badly overridden" error.</div><div>I think that on overriding would be useful to override the type for an inherited type. The actual constraint model is squeezing my brain. </div><div><br></div><div>Regards.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El sáb., 8 jun. 2019 a las 12:43, Tobias Boege (<<a href="mailto:taboege@gmail.com">taboege@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 05 Jun 2019, Yeshua Rodas wrote:<br>
> Hello coders.<br>
> <br>
> You'll see, I'm a PHP developer, but I found Gambas fun and enjoyable for<br>
> practice and teaching. However, after days of searching there is some<br>
> issues<br>
> for that I did not found any answer, so here I am asking.<br>
> <br>
> First: there is no a "PROTECTED" scope? I found tipical Public and Private<br>
> scope for class members on Gambas, but why is not there a Protected scope?<br>
> Or<br>
> is used another key word for that?<br>
> <br>
<br>
There is no such thing. Instead there is a convention (supported by the IDE)<br>
to prefix public members and methods with an underscore to indicate that they<br>
are hidden and using them voids any warranty.<br>
<br>
> Second: is there some kind of support for Interfaces? If you see Java or<br>
> PHP<br>
> yo found that for some Abstract Data Types is possible define an Interface,<br>
> you know, a set of public methods that define how an ADT must behave.<br>
> However,<br>
> I do not found any similar on Gambas.<br>
> <br>
<br>
Interfaces (in the sense of making duck typing formal) are not supported<br>
either. The only tool you have is inheritance, and there is no multiple<br>
inheritance.<br>
<br>
> Third: Abstract classes? I'm not sure if declaring on a class File "CREATE<br>
> PRIVATE" I am defining a kind of Abstract class.<br>
> <br>
<br>
Create Private means precisely that you cannot create instances of a class.<br>
You can still derive other classes. Providing implementations of methods<br>
and properties *is also* allowed, so depending on what you understand as<br>
an "abstract class" exactly, this may not fit.<br>
<br>
You cannot mark a method or property as a "stub", so that a deriving class<br>
which does not implement it causes a "you have to implement abstract ..."<br>
error. You would have to raise those errors yourself in the implementations<br>
of the methods in the abstract parent.<br>
<br>
Note that you have to call methods and properties using Me.<something><br>
in the parent class to have them resolve dynamically (to the actual method<br>
as implemented in the current object inheriting the abstract class)<br>
instead of lexically (to the empty method in the abstract class).<br>
<br>
> Fourth: Traits or mixins? this structures allow to languages that only<br>
> support<br>
> simple inheritance a way to reuse a lot of code. I'm thinking that maybe<br>
> using<br>
> Composition over Inheritance can be a solution, but I'm just aware if<br>
> traits<br>
> or mixins can be supported on Gambas.<br>
> <br>
<br>
No such thing.<br>
<br>
Benoît is on record saying that these features are missing in Gambas<br>
because the "bas" in Gambas comes from "BASIC". Introducing all these<br>
Java- and C++-esque features are very much not that.<br>
<br>
Regards,<br>
Tobi<br>
<br>
-- <br>
"There's an old saying: Don't change anything... ever!" -- Mr. Monk<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>E. Yeshua Rodas<br></div>DTI - UPNFM<br></div></div>