piecharts borken r19279

Mike Alexander mta at umich.edu
Sat Jun 19 16:26:15 EDT 2010


--On June 19, 2010 10:07:46 PM +0200 Christian Stimming 
<stimming at tuhh.de> wrote:

> Am Saturday 19 June 2010 schrieb Herbert Thoma:
>> Hi,
>>
>> after updating from svn piecharts are broken for me.
>> Piecharts worked before, the last update was about a week ago.
>
> That one goes on me (r19253, r19252), sorry for that. I hope I have
> disabled  enough the new feature now (in r19280). Seems to me I might
> still have messed  up the Scheme case-syntax in date-utilities.scm,
>
> (define (gnc:date-get-fraction-func interval)
>   (case interval
>     ('YearDelta gnc:date-to-year-fraction)
>     ('MonthDelta gnc:date-to-month-fraction)
>     ('WeekDelta gnc:date-to-week-fraction)
>     ('DayDelta gnc:date-to-day-fraction)
>     (else #f)))
>
> and my intention was that if "interval" has the value #f or 'None,
> this  statement should return #f, but for the four other symbols it
> should return  the values of the other variables. However, the error
> message indicates this  isn't the correct syntax for the else-branch
> if "interval" had the value 'None  :
>
>> In file
>> "/usr/local/share/gnucash/scm/date-utilities.scm", line 191: Bad case
>> labels #@else in expression (case interval ((quote YearDelta)
>> gnc:date-to-year-fraction) ((quote MonthDelta)
>> gnc:date-to-month-fraction) ((quote WeekDelta)
>> gnc:date-to-week-fraction) ((quote DayDelta)
>> gnc:date-to-day-fraction) (#@else #f)).
>
> Some Scheme help, anyone?

I think you need parens around the selectors in the case clauses.  I 
haven't tested this, but something like this might work:

(define (gnc:date-get-fraction-func interval)
  (case interval
    (('YearDelta) gnc:date-to-year-fraction)
    (('MonthDelta) gnc:date-to-month-fraction)
    (('WeekDelta) gnc:date-to-week-fraction)
    (('DayDelta) gnc:date-to-day-fraction)
    (else #f)))

It uses this syntax because you can have more than one selector in a 
single clause.

     Mike




More information about the gnucash-devel mailing list