| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hello group, just studding the xpce documentation. I wonder whats the difference betwee Meta and Super in the pce_begin_class statement. A hint to the section I've over read will be fine. Thanks for any Hints. -- Gruß Stephan |
|
#2
| |||
| |||
| On 2008-07-25, Stephan Lukits <Stephan.Lukits@FernUni-Hagen.de> wrote: > Hello group, > just studding the xpce documentation. > I wonder whats the difference betwee Meta and Super in the > pce_begin_class statement. > A hint to the section I've over read will be fine. Super is, well you probably know ... Meta is the class this class is an *instance* of. I.e. it defines properties of the *class* instead of the instances. The concept is (unfortunately) no longer present in many mainstream object systems :-( --- Jan |
|
#3
| |||
| |||
| Jan Wielemaker wrote: > On 2008-07-25, Stephan Lukits <Stephan.Lukits@FernUni-Hagen.de> wrote: >> I wonder whats the difference betwee Meta and Super in the >> pce_begin_class statement. > > Super is, well you probably know ... Meta is the class this class is > an *instance* of. Since I've slept over it and kept studding the manual, I figured that classes are handled as objects as well. This would mean I could define a class c ( a class of type class ) defining a bunch of variables in it. Now I could define a few classes c1, ..., cn of type object with c as meta, thus all of them would have the variables as attribute but there would be still only one set of those variables in the memory, right? And if I would define methods in c they would be independent from a specific object; even though at least one object from an instance (c1,...,cn) of c has to exist to bring c as a class object in existence, I guess? BTW, besides the high information density of the manual, a very impressive piece of software, thanks. -- Gruß Stephan |
|
#4
| |||
| |||
| On 2008-07-31, Stephan Lukits <Stephan.Lukits@FernUni-Hagen.de> wrote: > Jan Wielemaker wrote: > >> On 2008-07-25, Stephan Lukits <Stephan.Lukits@FernUni-Hagen.de> wrote: >>> I wonder whats the difference betwee Meta and Super in the >>> pce_begin_class statement. >> >> Super is, well you probably know ... Meta is the class this class is >> an *instance* of. > > Since I've slept over it and kept studding the manual, I figured that > classes are handled as objects as well. This would mean I could define Yes. > a class c ( a class of type class ) defining a bunch of variables in it. > Now I could define a few classes c1, ..., cn of type object with c as > meta, thus all of them would have the variables as attribute but there > would be still only one set of those variables in the memory, right? Yes and no. You have one variable as an attribute of the class, but to the instances it does not behave as a normal attribute. I.e. you have to read it as ?- get(Object?class, something, Value). > And if I would define methods in c they would be independent from a > specific object; even though at least one object from an instance > (c1,...,cn) of c has to exist to bring c as a class object in > existence, I guess? XPCE creates class objects lazily. That means, first access that requires a class creates the class object. That should be completely transparent to the user. > BTW, besides the high information density of the manual, a very > impressive piece of software, thanks. Thanks. Its a lightweight and fast GUI for Prolog. In retrospect, some things went wrong in the design. If I had to do it all over again, I guess I'd use a pure Prolog OO system (like Logtalk) and create a (lazy) mapping to the graphics system. But then, there are problems with that too and when XPCE was designed (mainly by Anjo Anjewierden) on a SUN workstation with 4MB memory, this was an attractive option. Cheers --- Jan |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.