× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Barbara Morris wrote:

When you say your recursion experiments suggest dynamic, you're talking about the storage type for the variables (see Joe Pluta's original post in this thread). You probably had variables in automatic storage, which meant you got new storage for each recursion. If you had coded STATIC, you would have seen different results (same variable for all recursions).

Actually, given that ILE RPG supports neither inline true inner blocks (i.e., blocks with local variables in inline code), nor nested procedure definitions, most of the difference between dynamic and lexical scoping falls away (at least unless you've got something that looks like the test case in the Wikipedia article).

But you are correct (and it goes to show just how much programming language design theory I've forgotten), in that I was asking the wrong question. The issue with the program in question was really a matter of local scope overriding global. (To restate what had happened, the programmer in question had intended DS definitions in an INCLUDE to overlay file fields, but because he'd put the include in at procedure level instead of module level, they were *overriding* rather than *overlaying* the file fields.)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.