[racket-dev] Strange definition of dict-count in docs and tests
Hi!
The documentation about gen:dict
http://docs.racket-lang.org/reference/dicts.html#%28def._%28%28lib._racket%2Fdict..rkt%29._gen~3adict%29%29
says that dict-count accepts one argument. But then it is defined with
a #:default argument:
(define (dict-count dict #:default [x #f])
(or x
(length (remove-duplicates (alist-v dict) #:key car))))
It doesn’t produce an error, but can’t imagine a realistic usecase of
#:default with this definition. I think that the #:default argument
should be dropped.
Gustavo
The same code appears in:
pkgs/racket-pkgs/racket-doc/scribblings/reference/dicts.scrbl
Lines 146-148
pkgs/racket-pkgs/racket-test/tests/generic/alist.rkt
Lines 16-18
pkgs/racket-pkgs/racket-test/tests/generic/struct-form.rkt
Lines 16-18