nmh-workers
[Top][All Lists]
Advanced

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

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


From: Paul Fox
Subject: Re: [Nmh-workers] new marker format broke test suite
Date: Tue, 06 May 2014 15:34:46 -0400

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, address@hidden (arlington, ma, where it's 55.4 degrees)



reply via email to

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