I am writing a tool to work with the latest stable release of m4 and need to define macros on the command line with the use of the '-D' flag.
When doing this however I have found a what I think is quite strange:
If the value of the definition contains only alphabet characters then the definition does not take place.
If, however, there is any kind of symbol the definition does take place and the macro expands as it should.
Now I am aware that is the string is quoted with the `' then the value is passed but this means that I cannot refer to other macro definitions from the command line.
Below is the output from the different tests: ----------------------------------------------------------------- TEST 1: just alphabet characters > m4 test.m4 -D_TEST_=newdef :: -- test.m4
expandforme stangeness ------------------------------------------------------------------ TEST 2: with symbols > m4 test.m4 -D_TEST_=`n'ewdef :: -- test.m4
newdef stangeness ---------------------------------------------------------------- TEST 3: quoted trying to refer to another defined macro > m4 test.m4 -D_TEST_="`newdef _TESTTWO_'" :: -- test.m4
newdef _TESTTWO_ stangeness ----------------------------------------------------------------
Attached is the file I used for this test.
If there is a logical explanation and work around that would be great, otherwise it would be really helpful if it was fixed.
Thanks, Stephen Borneman
:: -- __file__ define(_TEST_,expandforme)dnl define(_TESTTWO_,stangeness)dnl
_TEST_ _TESTTWO_
_______________________________________________ Bug-m4 mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-m4
