How to talk about prototypes

Help requests on developing Logtalk applications

Moderator: Paulo Moura

Post Reply
joerg
Posts: 40
Joined: Fri Dec 21, 2007 9:38 am

How to talk about prototypes

Post by joerg » Tue May 19, 2009 11:32 am

Hello,

In Logtalk there are different types of inheritance. I usually use prototype inheritance. My problem is that I do not know how to talk properly ("Logtalkishly") about my objects in the documentation of my programs. An example: Suppose we have these objects:

Code: Select all

:- object(morphosyntactic_category,
    extends(linguistic_entity)).

    :- public(values/1).
                        
:- end_object.


:- object(person,
    extends(morphosyntactic_category)).

    values([first, second, third]).
                                   
:- end_object.


:- object(number,
    extends(morphosyntactic_category)).

    values([singular, plural]).
                                   
:- end_object.


:- object(case,
    extends(morphosyntactic_category)).

    values([nominative, genitive, dative, accusative]).
                                   
:- end_object.


:- object(word,
    extends_object(linguistic_unit)).

    :- public(morphosyntactic_categories/1).
                                            
:- end_object.


:- object(noun,
    extends(word)).

    :- public(paradigm/1).

    morphosyntactic_categories([case, number]).

:- end_object.

I would like to make statements of the following type:


We introduce morphosyntactic categories as objects of their own. By giving them a method 'values/1' we represent the fact that each morphosyntactic category comes with a set of possible values. We introduce 'person', 'number' and 'case' as sub-objects/sub-classes/... of 'morphosyntactic category' to represent the fact that ..."


The bold phrase is the problematic part. What are the objects 'person', 'number' and 'case' in relation to the object 'morphosyntactic_category'?

Jörg

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: How to talk about prototypes

Post by Paulo Moura » Tue May 19, 2009 11:49 am

joerg wrote: I would like to make statements of the following type:


We introduce morphosyntactic categories as objects of their own. By giving them a method 'values/1' we represent the fact that each morphosyntactic category comes with a set of possible values. We introduce 'person', 'number' and 'case' as sub-objects/sub-classes/... of 'morphosyntactic category' to represent the fact that ..."


The bold phrase is the problematic part. What are the objects 'person', 'number' and 'case' in relation to the object 'morphosyntactic_category'?
I would write "... as derived objects of the 'morphosyntactic category' parent prototype/object to ...". I guess 'morphosyntactic category' cannot be a protocol instead of an object thus allowing 'person', 'number' , ..., to be presented as objects implementing the protocol?
Paulo Moura
Logtalk developer

joerg
Posts: 40
Joined: Fri Dec 21, 2007 9:38 am

Re: How to talk about prototypes

Post by joerg » Tue May 19, 2009 12:20 pm

as derived objects of the 'morphosyntactic category' parent
Thanks for the tip.
I guess 'morphosyntactic category' cannot be a protocol instead of an object thus allowing 'person', 'number' , ..., to be presented as objects implementing the protocol?
First, the code I gave was just an example. But, secondly, I think that in this case as well as in many other cases using protocols would complicate things unnecessarily.

Jörg

joerg
Posts: 40
Joined: Fri Dec 21, 2007 9:38 am

Re: How to talk about prototypes

Post by joerg » Tue May 19, 2009 12:35 pm

Would it be misleading to simply call 'person' a child or a descendant of 'morphosyntactic_category' and to call 'morphosyntactic_category' a parent or an ancestor of 'person'?

(In the documentation that I am writing right now, I simply do not want to bother the reader with a discussion of the different types of inheritance that Logtalk knows.)

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: How to talk about prototypes

Post by Paulo Moura » Tue May 19, 2009 1:28 pm

joerg wrote: Would it be misleading to simply call 'person' a child or a descendant of 'morphosyntactic_category' and to call 'morphosyntactic_category' a parent or an ancestor of 'person'?
No. The terms descendant and ancestor are also used e.g. in the library protocol "hierarchyp" for describing both class-based hierarchies and prototype-based hierarchies.

P.S. If you have a public web page describing your Logtalk application I will be happy to add a link to the "Links" section of the Logtalk web site.
Paulo Moura
Logtalk developer

joerg
Posts: 40
Joined: Fri Dec 21, 2007 9:38 am

Re: How to talk about prototypes

Post by joerg » Tue May 19, 2009 1:40 pm

Thanks for your tips. I think I will use the child/descendant-parent/ancestor-terminology.
P.S. If you have a public web page describing your Logtalk application I will be happy to add a link to the "Links" section of the Logtalk web site.
I cannot promise anything, but I will certainly think of the Logtalk page when this should become relevant.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest