nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] new marker format broke test suite

2014-05-06 14:35:05
ken wrote:
hmm. referring to the comments in fmt_compile.h, i see that rather than
implementing a "modifies str" function, as above, i've done an "outputs
text" function, like so:

    { "metric", TF_EXPR, FT_METRIC, 0, 0 },

i guess i'm not sure why i'd choose one over the other.

Other than the put* functions, there are no "pure output" functions.
Every function that generates output stores the output in "str", and
has TFL_PUTS (or TFL_PUTN) flag so the appropriate PUTSTR instruction
is generated when appropriate.

Why?  Well, think about the case when you want to use the output of
that function in another function.  There probably aren't many uses
for that, but what about something you might want to do in a scan
format:

     %-6(putstr(metric(size)))

You are probably thinking you could do:

     %-6(metric(size))

.... except that only works if there's an implicit PUTSTR (which is
generated when the function is flagged with TFL_PUTS).

i see, thanks.  i do get output, but it's because i've essentially
implemented another put* function.  i'll change that.

as for the name:  i'm not sold on "metric" either.  something like
"numabbrev", "numunits", or maybe "si_units"?

paul
----------------------
 paul fox, pgf(_at_)foxharp(_dot_)boston(_dot_)ma(_dot_)us (arlington, ma, 
where it's 55.4 degrees)

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>