chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #837: statistics: some bugs


From: Chicken Trac
Subject: Re: [Chicken-janitors] #837: statistics: some bugs
Date: Sun, 13 May 2012 14:28:52 -0000

#837: statistics: some bugs
-------------------------+--------------------------------------------------
  Reporter:  sjamaan     |       Owner:  petercrlane
      Type:  defect      |      Status:  new        
  Priority:  minor       |   Milestone:             
 Component:  extensions  |     Version:  4.7.x      
Resolution:              |    Keywords:             
-------------------------+--------------------------------------------------
Description changed by sjamaan:

Old description:

> The scrutinizer found a few bugs in statistics.  The first one in
> {{{wilcoxon-signed-rank-test}}} initially looked like a simple mistake of
> swapping the arguments to {{{list-ref}}}, but even after fixing that I
> was unable to get it to do anything but error out.
>
> {{{
> #1;> (use statistics srfi-1)
> #2;> (wilcoxon-signed-rank-test (iota 17))
> ;; ERROR
> }}}
>
> After adding some debugging code, it looks like the indexes are wrong;
> {{{last}}} is determined counting from the end of the list, but it
> *looks* like the code is treating it as if it's counted from the front.
> After changing that accordingly I still kept getting errors, so I'll
> leave that to you.  I decided to let my patch simply fix these warnings
> and nothing more.
>
> The second message about {{{wilcoxon-signed-rank-test}}} refers to the
> fact that {{{var-r1}}} is being applied as if it were a procedure.
> However, it's just a number, so this would fail.
>
> The warning about {{{mcnemars-test}}} is due to the fact that the return
> value of {{{set!}}} is undefined in Scheme (this is different from Common
> Lisp, where {{{setf}}} returns the last value set, I think).  I don't
> really understand the purpose of the named let, so I didn't touch it
> (instead just doing a simple transformation that's always safe), but it
> really looks like it doesn't do anything at all.
>
> Attached is a patch that gets rid of these warnings.

New description:

 The scrutinizer found a few bugs in statistics (see http://tests.call-
 cc.org/master/linux/x86/2012/05/12/salmonella-
 report/install/statistics.html).  The first one in {{{wilcoxon-signed-
 rank-test}}} initially looked like a simple mistake of swapping the
 arguments to {{{list-ref}}}, but even after fixing that I was unable to
 get it to do anything but error out.

 {{{
 #1;> (use statistics srfi-1)
 #2;> (wilcoxon-signed-rank-test (iota 17))
 ;; ERROR
 }}}

 After adding some debugging code, it looks like the indexes are wrong;
 {{{last}}} is determined counting from the end of the list, but it *looks*
 like the code is treating it as if it's counted from the front.  After
 changing that accordingly I still kept getting errors, so I'll leave that
 to you.  I decided to let my patch simply fix these warnings and nothing
 more.

 The second message about {{{wilcoxon-signed-rank-test}}} refers to the
 fact that {{{var-r1}}} is being applied as if it were a procedure.
 However, it's just a number, so this would fail.

 The warning about {{{mcnemars-test}}} is due to the fact that the return
 value of {{{set!}}} is undefined in Scheme (this is different from Common
 Lisp, where {{{setf}}} returns the last value set, I think).  I don't
 really understand the purpose of the named let, so I didn't touch it
 (instead just doing a simple transformation that's always safe), but it
 really looks like it doesn't do anything at all.

 Attached is a patch that gets rid of these warnings.

--

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/837#comment:1>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

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