Hugh,

I think you should look at "Parameterized constructers" in the help to  
answer your question about arranging parent/child constructors.

About overriding the methods of the parent class: just define a method  
for the child class.

 From my experience with OOP in Factor, nearly all code is written as  
"external functions" rather than "member functions".  Methods are used  
only in the case that code needs to dispatch based on the type of an  
object.  These dispatching words are "low-level" in the sense that  
words that call them don't need to involve dispatching and hence tend  
not to be methods.

The point of Factor OOP (to me) is to allow one to quickly write code  
that does different things for different objects while not forcing one  
to write extra boilerplate for non-dispatching code.

Have fun!
Matthew Willis

On May 15, 2009, at 1:40 PM, Hugh Aguilar wrote:

> I've already seen those links you mentioned, but I'm still confused.  
> How do
> I define a constructor that will chain-call the constructors for the  
> parent
> classes? I want to define a class that is derived from symtab
> (www.rosycrew.org/symtab.factor) and which adds some new slots. The
> constructor for this new class shouldn't have to concern itself with  
> (or
> even know about) the symtab slots: count, left and rite. In C++  
> these would
> be private, as they are low-level details that the user of the class  
> (the
> programmer of the derived class) doesn't need to know about. How do I
> override the member functions of the parent class? My symtab program  
> used
> TUPLE, but it wasn't OOP at all because the functions that dealt  
> with the
> tuple weren't member functions of that tuple; they were just external
> functions. My symtab was like a C program except that it used the
> computer-sciency term "tuple" rather than "struct." I'm still not  
> getting
> how OOP works in Factor.
>
>
>> Message: 3
>> Date: Sat, 9 May 2009 19:51:17 +0200
>> From: zimbatm <[email protected]>
>> Subject: Re: [Factor-talk] OOP tutorial
>> To: [email protected]
>> Message-ID:
>> <[email protected]>
>> Content-Type: text/plain; charset=UTF-8
>>
>> Basically, a class is defined with a TUPLE. Some examples :
>> http://docs.factorcode.org/content/article-tuple-examples.html
>>
>> For a more general description, see:
>> http://docs.factorcode.org/content/article-objects.html
>>
>> The doc is generally well constructed. The idea is to put as much
>> informations in the factor documentation system so it doesn't get out
>> of sync. Contributors also accept comments and patches if you feel  
>> for
>> it.
>>
>> Regarding CLOS, I've read somewhere Slava saying it heavily  
>> influenced
>> factor but I don't know much about it.
>>
>> Cheers,
>>  zimbatm
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to