Christopher Browne <[EMAIL PROTECTED]> writes:

> >   (output-line
> >     (line-append
> >       (report-string linedata 1 "Net Income (Loss)" 0 'TotalDescription)
> >       (report-total linedata grand-total-collector #f
> >                     2 "Net Income" 'CreditTotalAmount))
> >     sample-port)
> 
> This doesn't work because we shouldn't assume that the items are put
> into the list in order, and we don't know how many arguments there will
> be.

Hmm.  I must be missing something here.  The order within the line's
not relevant?  Doesn't matter...  I presume you know what you mean,
and that's what counts :>

With respect to the argument count, you could also just allow
line-append to have an arbitrary number of arguments, but see next
comment...

> What may be better is thus:
> 
> (output-line
>     sample-port
>     (report-string sample-port stuff)
>     (report-total sample-port stuff))

I like this as well or better than my approach anyway.

> report-string and report-total.  What bugs me a bit is that I have
> to pass in sample-port just about everywhere.

That doesn't bother me at all.  It makes it completely clear what's
going on, and you can always use a local let to abbreviate the port
name as "p" or something if you're having trouble with "running of the
right of your page".

> The only problem with that is that I don't think I like having to
> have the functions (report-string) and (report-total) return values.
> Or perhaps I'm overconcerned.

Why not?

In any case, I was fine with your first approach: 

  (let ((linedata (initialize-line sample-port)))
    (report-string linedata stuff)
    (report-total linedata stuff)
    (output-line linedata))

This is just a little different than yours since here linedata keeps
track of the port it was initialized with.

Either way...

-- 
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930

--
Gnucash Developer's List 
To unsubscribe send empty email to: [EMAIL PROTECTED]

Reply via email to