× 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.



On Wed, Oct 20, 2021 at 2:53 PM Mark Waterbury
<mark.s.waterbury@xxxxxxxxxxxxx> wrote:

Justin,
This proposed feature might work okay in any interpreted language like AWK, PHP, Python, PERL, or Javascript, etc., but would be difficult to impossible to implement this in compiled languages like ILE RPG IV, or ILE COBOL or ILE C/C++ or ILE CL.

Really? So then how do C and C++ already provide string interpolation
via printf and sprintf, as discussed by others in this thread?

Granted, printf and sprintf are not, IMO, as nice as the proposal.

To do so would require that the runtime routines, (e.g. "printf" in the example), would need to be able to access the symbol table of the compiled program. The symbol table is normally only available at "compile time" unless you compile with "debug" enabled. To access the debug symbol table would require running the program "in debug mode." :-/
I think it would require a huge effort to implement this, for relatively little real benefit.

It doesn't strike me as a "huge" effort, since it can be implemented
as syntactic sugar for concatenation or %SCANRPL, plus %CHAR. (In
other words, help people do what they are already doing, but easier to
write, easier to read, and less error-prone.) For those who do a lot
of string processing, it is significantly more convenient than
existing alternatives. Even Scott Klement seems to think the idea (1)
is feasible and (2) would provide noticeable benefit.

John Y.

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.