Proposal: count David Van Horn (20 Sep 2009 22:58 UTC)
Re: Proposal: count Alexey Radul (21 Sep 2009 00:00 UTC)
Re: Proposal: count David Van Horn (21 Sep 2009 00:04 UTC)
Re: Proposal: count Alexey Radul (21 Sep 2009 00:44 UTC)
Re: Proposal: count David Van Horn (21 Sep 2009 15:24 UTC)
Re: Proposal: count Taylor R Campbell (21 Sep 2009 00:51 UTC)
Re: Proposal: count David Van Horn (21 Sep 2009 14:56 UTC)

Re: Proposal: count David Van Horn 21 Sep 2009 14:56 UTC

Taylor R Campbell wrote:
>    Date: Sun, 20 Sep 2009 18:58:38 -0400
>    From: David Van Horn <xxxxxx@ccs.neu.edu>
>
>    While `length' gives you number of pairs in a list, it's also useful to
>    determine the number of pairs in a (potentially) improper list.
>
> When might one want to do this?

It's useful for bounds checking.  Actually, I think a more useful
operation would be something like:

    (lenth<=? obj k) -> bool

Which would be the same as (<= (count obj) k).   This operation would
take O(min(log(count obj),log k)).  It's important to note that obj need
not be a list.

David