Re: Help Constructing Fictional Cross-Religious Movement



Wilson Heydt wrote:
In article <m2wtm8i75q.fsf@xxxxxxxxxxxxxxxxxxxxxxx>,
Charlton Wilbur  <cwilbur@xxxxxxxxxxxxxx> wrote:
"WH" == Wilson Heydt <whheydt@xxxxxxxxxxx> writes:
I suspect we're running into a nomenclature issue here, but I'm not
familiar enough with COBOL to know for sure.  When you say
"subroutine," are you speaking of what I'd call a function in C?
i.e., a chunk of code that takes some number of arguments, possibly
modifies them, and possibly returns a value?  one entry point?

With the caveat that, while a COBOL subroutine can return a value, it isn't normally done that way. Usually one passes some number of parameters and one of those is where any return data is stuffed. One can write single subroutines, or collect them into either statically or dynamically linked libraries.

I believe you'd also made the caveat earlier that COBOL subroutines can have multiple entry points. In Fortran, the multiple entry points can also have different argument lists.


Also, I'm not completely sure if C has the capability to save the values of a function's local variables between calls to the function. I suspect it probably does, though.

The result of this is that it seems to be nearly equivalent to the computer-science ideal of a function, but it can be used to implement an object that's limited to having exactly one instance (and that instance being in global namespace, I think). The fact that it can be used to do this is probably one of those things that is trivially obvious to people with Hal's experience, but doesn't occur to many people who are writing Java books. :)

- Brooks


-- The "bmoses-nospam" address is valid; no unmunging needed. .



Relevant Pages

  • Re: Help Constructing Fictional Cross-Religious Movement
    ... >> language." ... > I would note, though, that the use of "subroutine" in this ... > persistent local data for storing this sort of thing. ... multiple entry points and persistent local data, ...
    (rec.arts.sf.composition)
  • Re: ArrayList - Newbie Misunderstanding
    ... different from a subroutine with multiple entry and exit points - in ... subprogram can either be local or global. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help Constructing Fictional Cross-Religious Movement
    ... With the caveat that, while a COBOL subroutine can return a value, it isn't normally ... Most compilers will come with function and subroutine libraries as well. ... The problem for me has been when people teaching OO, and Java ... but practice will probably resolve that as well. ...
    (rec.arts.sf.composition)
  • Re: Help Constructing Fictional Cross-Religious Movement
    ... No. Subroutines (at least in COBOL) normally do ... WH> practical difference between an object and a subroutine. ... WH> How about one for making Java programmers out of COBOL ...
    (rec.arts.sf.composition)
  • Re: Help Constructing Fictional Cross-Religious Movement
    ... > Hasn't worked yet for Java, but that's gotten a bit better since I ... I even watched one assert that Java ... > knows a lot more COBOL tha he does--his assertions about COBOL ... A subroutine is "just code". ...
    (rec.arts.sf.composition)