XPost: comp.lang.scheme
(define (Score X Y)
(list (count (lambda (y) (member y X)) Y)
(count equal? X Y)))
Where can i find doc for COUNT ?
The section in the Gauche manual is so short!
but now i see that it explains what i was looking for
> the count of times pred returned true is returned.
https://practical-scheme.net/gauche/man/gauche-refe/Pairs-and-lists.html
Function: count pred clist1 clist2 …
[R7RS list] A procedure pred is applied to the n-th element of given lists, from n is zero to the length of the the shortest finite list in the given lists, and the count of times pred returned true is returned.
(count even? '(3 1 4 1 5 9 2 5 6)) ⇒ 3
(count < '(1 2 4 8) '(2 4 6 8 10 12 14 16)) ⇒ 3
At least one of the argument lists must be finite:
(count < '(3 1 4 1) (circular-list 1 10)) ⇒ 2
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)