[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] strange defining of undefined names
From: |
Werner LEMBERG |
Subject: |
Re: [Groff] strange defining of undefined names |
Date: |
Thu, 04 Jul 2002 15:41:45 +0200 (CEST) |
> There is a strange anomaly about undefined names in
> commented/ignored environments. Try the following roff fragments:
>
> 2.
> .rm s
> \c comment on \*[s]
> .ie d s .tm yes
> .el .tm no
>
> This prints `yes' - strange.
\c only suppresses output of the rest of the line, nevertheless it is
parsed. `s' isn't found, thus groff emits a warning and defines `s'
to be empty. For example, this works:
\c\R'xxx 4'
.tm xxx = \n[xxx]
=> xxx = 4
This is already documented in groff.texinfo.
Can someone please test Bernd's example with AT&T troff?
> 3.
> .rm s
> .ig
> comment on \*[s]
> ..
> .ie d s .tm yes
> .el .tm no
>
> This prints `yes' - strange.
.ig is the same as .de except that the parsed data is discarded. If
you write \\*[s], `s' won't be expanded.
> 4.
> .de c
> ..
> .rm s
> .c comment on \*[s]
> .ie d s .tm yes
> .el .tm no
>
> This prints `yes' - strange.
Arguments of a macro are always parsed regardless whether the macro is
empty or whether the arguments are used actually. Since groff tries
to immediately interpolate strings and registers, it checks whether
`s' is defined.
Werner