[Gambas-user] Class info contradicts by Gambas added class info
Willy Raets
willy at ...2734...
Sat Sep 20 00:17:35 CEST 2014
On vr, 2014-09-19 at 22:30 +0200, Tobias Boege wrote:
> On Fri, 19 Sep 2014, Willy Raets wrote:
> > Hi all,
> >
> > I have this Gambas library.
> > I have made sure classes have their description (using ''' at the
> > beginning) and public functions/methods have their description (using ''
> > just before the function/method)
> >
> > I have this exported class named Update.
> > When typing Update in an application using the library the help shows up
> > with info on the class Update (see Screenshot01.png)
> >
> > I can correctly see my info, being:
> > "Update provides methods for handling your application updates, version
> > checking,
> > provide online information from (rich) text files and show changelog.
> > This class is not creatable."
> >
> > But I can also see that Gambas seems to add stuff:
> > "This class can be used like an object by creating an hidden instance on
> > demand.
> > This class is creatable."
> >
> > Now these two are a contradictions. My help info says:
> > "This class is not creatable."
> > Gambas adds info:
> > "This class is creatable."
> >
> > The class Update is an exported class, but all functions and methods are
> > Static. (see Screenshot02.png)
> > No instances can be made of the class nor of it's public
> > functions/methods.
> >
> > I noticed this in Gambas 3.5.4, had a look (in VM) at an installed
> > Gambas 3.5.90 (#rev.6469), but there the info is the same.
> >
> > Shouldn't a class with Create static NOT show the added Gambas info on
> > being able to be created, or am I misunderstanding something?
> >
>
> I think you can instantiate your class, even if everything is static in
> there and you have Create Static set -- the instance you get from New would
> just be rather useless.
I guess it could, but as _new() isn't even in the code it would not be
very useful. So, from the point of view of a developer using the library
the added gambas info is misleading at least and in contradiction.
I'm trying to tell them to to instantiate as it is useless. Gambas added
info tells the opposite.
This is what wiki says on the subject of a static class:
"1.1. Classes
....
A static class is a class whose all members are static (see below). In
Gambas, a static class is also named a module.
A static class cannot be instantiated: it would create an object with no
dynamic variable, which is useless."
Source: http://gambaswiki.org/wiki/doc/object-model
> (IIRC I tried that a few days ago: I tried to create
> an object of a module, and it worked!) The only thing which would forbid
> instantiation is the Create Private keyword.
--
Kind regards,
Willy (aka gbWilly)
http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org
More information about the User
mailing list