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



IMHO, you are thinking about this the wrong way, Mark.   It wouldn't pass the string containing the symbols to a routine and expect that routine to look up the data in the variables.

Instead, it'd just be an alternative syntax for a string expression.   The RPG compiler would compile this:

myString = `Hello ${YOURNAME}, nice to meet you`;

And it would result in the exact same underlying code that it currently generates when it compiles this:

myString = 'Hello ' + %trim(YOURNAME) + ', nice to meet you';

It's just an alternate syntax for the string expression, and would compile down to the same underlying code.  The buffer passed to any routine that's being called would already have the result of the expression in it, so wouldn't need to look anything up in the symbol table.

-SK


On 10/20/2021 1:53 PM, Mark Waterbury 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.
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.
Mark
On Wednesday, October 20, 2021, 11:27:21 AM EDT, Justin Taylor <jtaylor.0ab@xxxxxxxxx> wrote:
Description:

Add string interpolation support so variables can be inserted into string
literals without having to use concatenation with + symbols and multiple
literals.

For example:

apples = 4

bananas = 3

print(f"I have {apples} apples and {bananas} bananas")


http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=152890

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.