[Gambas-user] gb3: converting structures to classes

Randall Morgan rmorgan62 at ...626...
Tue Feb 7 20:32:56 CET 2012


Thanks for clearing that up Benoit!


2012/2/7 Benoît Minisini <gambas at ...1...>

> Le 07/02/2012 14:50, GMail a écrit :
> > On Tue, 2012-02-07 at 05:07 -0800, Randall Morgan wrote:
> >> Just restating the documentation....
> >>
> >> On Tue, Feb 7, 2012 at 5:05 AM, Bruce Bruen<bbruen at ...2308...>
>  wrote:
> >>
> >>> On Tue, 2012-02-07 at 04:07 -0800, Randall Morgan wrote:
> >>>> Actually, a Structure is a methodless class.
> >>> ggggzzzzzrrpppppppp!
> >>>
> >>> ... and you can inherit from, override and make static attributes from
> a
> >>> struct too?
> >>>
> >>> Please, lets keep things realistic here
> >
> > No, I don't think "A structure is exactly like a class that would have
> > only public variables" is the same thing as saying that a "Structure is
> > a methodless class".
> >
> > In fact, I would almost go further and say that the help should say that
> > a "structure is somewhat like a class, in that it exposes attributes
> > publicly (and in an unprotected manner) but it neither contains nor
> > exposes any functionality or feature typically associated with the
> > generally understood concept of an OO classifier."
> >
> > A class can inherit from any other gambas class (with one notable
> > exception - Form), it can have a constructor, destructor, initialisation
> > and finalization code and other special methods, it can have both
> > exposed (public or property based) data, it can contain specifically
> > differential static data, classes can override the methods of their
> > parent classes etc etc.
> >
> > I'm not having a go at you, its just that there is a bunch of mail
> > lately that seems to imply that a class is just a "fancy" structure. In
> > my opinion, it's quite different; a structure is just a "chunk of data",
> > conversely a class is much much more than that. Comparing the two is
> > like comparing penguins and pineapples.
> >
> > cheers
> > Bruce
> >
>
> Gambas structures are really Gambas objects, except that they can be
> embedded inside other objects or structures (you cannot embed a Gambas
> object inside another one).
>
> Beside that special behaviour (and two other ones in extern function
> management and stream management), Gambas makes no difference between a
> structure object and a normal object.
>
> And I have never tested inheritance and structure... Maybe not a good
> idea. :-)
>
> Otherwise, to get the real details, you have to read the interpreter
> source code! :-)
>
> Regards,
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?



More information about the User mailing list