[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [open-cobol-list] mvs cobol namespace
From: |
William M. Klein |
Subject: |
RE: [open-cobol-list] mvs cobol namespace |
Date: |
Thu Feb 5 22:46:31 2004 |
Does this use of the word "function" have nothing to do with the COBOL
concept of (user-defined - in 2002 Standard) functions, e.g.
What happens with a (valid in 2002 COBOL) statement
Move Function A-B (Parm1 Parm2) To XYZ
which is SUPPOSED to move the "returned value' (from the RETURNING phrase of
the Procedure Division) of the user-defined function "A-B" to field XYZ.
Sorry if my questions don't make sense to some on this list. I know COBOL,
I do *not* know C. I know what are valid program names (for nested and
outermost programs); I know what both user defined and intrinsic functions
are in COBOL; I know what COBOL methods and object definitions are ...
but I do NOT know how C works.
I want to "help" make OpenCOBOL "conform" to the current ('85, '89, and
2002) ANSI/ISO Standards ... and I *know* that other compilers can manage
this - no mater what type of object code (assembler, C, Java, whatever) the
compiler produces.
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Keisuke Nishida
> Sent: Thursday, February 05, 2004 11:54 PM
> To: William M. Klein
> Cc: 'David Korn'; address@hidden
> Subject: Re: [open-cobol-list] mvs cobol namespace
>
> At Thu, 5 Feb 2004 16:24:22 -0600,
> William M. Klein wrote:
> >
> > Therefore, my STRONG recommendation is do *NO( conversion
> for CALL "literal"
> > statements (or COPY "literal" statements). USE what the
> programmer enters.
> > If they want something different, then they should change
> their source code.
>
> OpenCOBOL uses program names for different two purposes: file name and
> function name. If you write a statement CALL "address@hidden", then
> open-cobol
> will try to find a file "address@hidden" and call a function address@hidden'
> in it.
> The function name can be anything in this case. What the programmer
> wants is to call the module "address@hidden". The function name is
> not visible
> to the programmer.
>
> Now, we don't do any conversion with file names. What I am thinking
> about is the function name, which is part of the internal
> call convention.
> Since function names are restricted to C names, I just wanted
> to encode
> them. (Yes, this might be confusing, but I think is acceptable.)
>
> At Thu, 5 Feb 2004 16:47:14 -0600,
> William M. Klein wrote:
> >
> > I am certain that SOME C compilers must support other
> "things" - because IBM
> > C can call IBM COBOL programs with "@" "$" or "#" in the
> program-name.
>
> With open-cobol you can do something like this:
>
> int (*func)();
>
> func = cob_resolve ("address@hidden");
> if (func)
> func (...);
> else
> /* error */
>
> The run-time function `cob_resolve' does everything you need,
> including
> function name encoding if necessary.
>
> Keisuke
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
>