|
I have long advocated that RPG should have const-and-I-mean-it whereby a copy is _always_ made. Then const would mean what most people already think it means!
On 2012-06-15, at 7:36 PM, rpg400-l-request@xxxxxxxxxxxx wrote:
What exactly scenario can you change the contents of a parameter that uses Const? If there's a scenario, open a PMR.Const means different things in the caller and the callee.
In the caller it means make a copy if the datatype/size does not exactly match.
In the callee it means read-only.
As a result regardless of what the caller codes, if the callee does not code const, the values can be changed. Whether the caller "sees" those changes or not depends on whether a copy was made. Since RPG III, CL, and COBOL have no proto capability then coding const in the caller really offers no protection. But a lot of people mistakenly think that by coding const that they are safe from any and all callee changes.
I have long advocated that RPG should have const-and-I-mean-it whereby a copy is _always_ made. Then const would mean what most people already think it means!
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
This mailing list archive is Copyright 1997-2026 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.