gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] binding design patterns for OC


From: Wim Niemans
Subject: Re: [open-cobol-list] binding design patterns for OC
Date: Sat, 24 Aug 2013 18:03:27 +0200

Patrick,

think libraries if you want name spaces.

Cobol is born in the time we compile and ran a link-edit step (nowadays called 
binding).
Than the binding became dynamic using a library, or just the file system.

If you just want to streamline calling sequences, than the record approach is 
ok.
I do use that for all software, ie call "routine" using control-bytes, 
parameter-area.
Whenever control-bytes or parameter-area changes, I do compile the whole again 
(continuously).

Look at the ILE concept of IBM.

Wim

Op 24 aug. 2013, om 16:48 heeft Patrick het volgende geschreven:

> Hi Everyone
> 
> This may be months away from becoming code but I am daydreaming about 
> using libclang to create a binding generator for Open Cobol. The thing 
> is, what good would it be if it didn't generate a sensible binding design.
> 
> Bindings are tough and there are a lot of considerations to take into 
> account. I figure one of the most important ones is to do no harm. 
> Namespace collisions ought to be high on the list of considerations, 
> especially with auto-generated code.
> 
> Would this be sensible:
> 
>   Outer-Scope program
> 
>   Many nested programs each taking one record as an argument and return 
> one record
> 
>   linkage section for Outer-Scope that takes one string,  one record 
> and returns one record
> 
>   procedure division that has one big evaluate statement that calls the 
> correct nested program and passes it the correct record
> 
>   End Outer-Scope
> 
> 
> If each nested program took one record, that record could contain any 
> number of parameters and they would not clutter the evaluate statement. 
> The returning record could likewise contain a variety of parameters.
> 
> This binding could then be complied in to the user-developers 
> application and the programs nested within the binding would  not 
> collide with his/her application.
> 
> The call would look a little funny in that the C function name is an 
> argument:
> 
> CALL "some-binding"
>         USING BY CONTENT "some-function",
>         USING BY VALUE some-record,
>         RETURNING another-record  .
> 
> 
> Any downsides to this or ways it could be improved? I thought I would 
> try my hand at several manually written bindings before trying something 
> automated.
> 
> Thanks for reading-Patrick
> 
> 
> 
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and 
> AppDynamics. Performance Central is your source for news, insights, 
> analysis and resources for efficient Application Performance Management. 
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list



reply via email to

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