bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU m4 1.4 problems


From: Barrie Stott
Subject: GNU m4 1.4 problems
Date: Sat, 29 Dec 2001 15:01:40 +0000
User-agent: Mutt/1.0.1i

Both the items I have are related to documentation. The first is where I think
it is wrong; the second relates to my inability to do something which seems
reasonable.

1. In section 7.4 Changing the lexical structure of words, all the uses of =>
seem to be faulty. The characters following => should be output (according to
section 1.5) but all 4 examples seem to be further input.

2. I want a list of items as in

        define(`__list', item1, item2, item3, item4)

and then I want to select an item using something like _list(3) to get item3.
I can get this with the following definitions:

        define(`_arg1', `$1')
        define(`_arg2', `$2')
        define(`_arg3', `$3')
        define(`_arg4', `$4')
        define(`_list', _arg$1(`__list'))

Everything here works as I would expect. However, having got so far, the
mathematician in me would like to have the definitions for `__list' and
`_list' generated for me by a call to a new definition, xdefine; something
like xdefine([_abc], [a1, a2, a3]) would generate:

        define(`_abc', _arg$1(`__abc'))
        define(`__abc', `a1, a2, a3')

I've twisted and turned all ways to get the `$1' part of the first of these
definitions. For example, the following is one of my efforts:

        define(`xdefine', `define(`_$1', `$2')
                define(`$1', `_args$`'1(`_$1')')')

which gives the definition of _abc as _arg$`'1(`__abc'): not what I want.
When I use

        define(`xdefine', `define(`_$1', `$2')
                define(`$1', `_args$1(`_$1')')')

the definition of _abc becomes _arg_abc(`__abc'): again, not what I want.

Is there some way to get the definition of _abc to be _arg$1(`__abc') ?

This is not a bug in the _existing_ documentation but it does suggest that
perhaps it is incomplete.

If you are able to shed light on this I would be very grateful.

Barrie.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]