Re: Confessions of an "OO Foreigner"

From: Donald Tees (donald_tees_at_nospam.sympatico.ca)
Date: 12/30/03


Date: Mon, 29 Dec 2003 22:16:43 -0500

LX-i wrote:
> (there is a reply down there somewhere....)
>
> William M. Klein wrote:
>
>> INVOKE specific-object-reference-data-item specific-method-name
>> USING various-parameter-by-CONTENT/REFERENCE/VALUE
>> RETURNING returned-value-data-item
>>
> ...
>
>> INVOKE method-name UPON object-reference-name USING ...
>>
>> Well, I lost <G> that battle and we ended up with INVOKE
>> object-reference. Once
>> we had "object-reference" as the object (grammatical usage) of the
>> INVOKE verb,
>> then I though we AT LEAST should have an OPTIONAL keyword explaining
>> "what"
>> (adverbial) we wanted to do with this "second" thing, the
>> method-name. What I
>> wanted was something like
>>
>> INVOKE object-reference <WITH> method-name USING ....
>>
>> Well, I lost <G> that battle and we ended up with two "nouns"
>> following the
>> INVOKE verb - with two VERY different meanings and no preposition
>> between them.
>> As far as I know, this is the ONLY time this exists in COBOL (which is
>> English
>> like) and totally (IMHO) obscures what the INVOKE statement does!!!
>
>
> I'm with you. Other languages use something like
> return-value = object.method(parameters)
>
> I'm surprised they didn't say
> INVOKE method-name OF object-name ...
>
> This utilizes a very familiar COBOL construct, which is used to uniquely
> identify data items.
>
> Any of you savvier OO guys know of a reason that that wouldn't make more
> sense?
>
>

In reply to that latter, you can do exactly that by using the set
property method to invoke a procedure.

        IE MOVE "action-required" TO INVOCATION-METHOD of object-name.

Donald



Relevant Pages

  • Re: Confessions of an "OO Foreigner"
    ... Other languages use something like ... >> This utilizes a very familiar COBOL construct, ... would you simply invoke the object? ...
    (comp.lang.cobol)
  • Re: Confessions of an "OO Foreigner"
    ... > INVOKE verb - with two VERY different meanings and no preposition between them. ... This utilizes a very familiar COBOL construct, ...
    (comp.lang.cobol)