Open GoogleCodeExporter opened 9 years ago
I tried to modify the "count" function defined in
/usr/share/ypsilon/sitelib/srfi/srfi-1.scm. Not sure whether this fulfill the
requirement of SRFI-1:
(define count
(lambda (proc lst1 . lst2)
(cond ((null? lst2)
(fold-1 (lambda (args acc)
(if (proc args) (+ acc 1) acc))
0
lst1))
(else
(fold-1 (lambda (arg acc)
(if (apply proc arg) (+ acc 1) acc))
0
(apply list-transpose* lst1 lst2))))))
Original comment by noctuor...@gmail.com
on 2 Mar 2013 at 2:57
I found the code in the SVN trunk is different from the one from .deb file.
I replace "%3a1.scm" and "srfi-1.scm" in my system with the ones from SVN. The
first example with only one list argument works, but the following examples
with more list arguments failed.
> (import (srfi :1))
> (count < '(1 2 4 8) '(2 4 6 8 10 12 14 16))
error: #<closure 0xb00fec0> expected 2, but 3 arguments given
irritants:
(1 2 0)
backtrace:
0 (count < '(1 2 4 8) '(2 4 6 8 10 12 14 16))
..."/dev/stdin" line 1
> (count < '(1 2 4 8) '(2 4 6 8 10 12 14 16))
error: #<closure 0x19711de0> expected 2, but 3 arguments given
irritants:
(1 2 0)
backtrace:
0 (count < '(1 2 4 8) '(2 4 6 8 10 12 14 16))
..."/dev/stdin" line 1
Original comment by noctuor...@gmail.com
on 2 Mar 2013 at 3:32
Original issue reported on code.google.com by
noctuor...@gmail.com
on 2 Mar 2013 at 2:33