[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] nested stubs technique ?

From: Patrick
Subject: [open-cobol-list] nested stubs technique ?
Date: Sat, 03 Aug 2013 23:38:26 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Hi Everyone

This isn't important but I am just a bit excited about something.

Cobol is criticized for not having enough structure. Within a single program I thinks it's the most structured language around but perhaps with many-many files things could get tricky compared to let's say Ada.

With Ada there are many ways to organize code but one way is the package. In the package there is a spec file and one or more body files. With the GNAT compiler this could look like this:

I have some issues with Ada and I am not using it now but it is really pleasant to read. You can just look for the .ads extension to find the spec file.

The .ads file has a sort of summary of the .adb files. You don't have to read the .adb files to have a rough idea of what is going on.

Along this line of thinking I tried this tonight:

       PROGRAM-ID. anak.
       COPY "/pat/cobol/nested-stubs/anak-body.cob".

      *Is private to anak scope but initialized each invocation
       PROGRAM-ID. anak-word-file-read IS INITIAL.
       COPY "/pat/cobol/nested-stubs/anak-word-file-read.cob".

      *Is public to anak scope
       COPY "/pat/cobol/nested-stubs/foo.cob".

       END PROGRAM anak.

The nested programs have their identification division within their parent but their code is written in another file. I thought I could heavily comment this parent file as well, creating a kind of summary file.

I could imagine using this for many-many nested programs, with many levels of scope, much like a Ada spec file.

Has anyone heard of someone doing this before? Surely I didn't invent it. Anyone see an issue laying things out this way?

I hope no one minds this not very important email...

Thanks for reading-Patrick

reply via email to

[Prev in Thread] Current Thread [Next in Thread]