[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hash table read syntax in guile 2.0
From: |
Ludovic Courtès |
Subject: |
Re: Hash table read syntax in guile 2.0 |
Date: |
Sun, 17 Feb 2013 14:41:53 +0100 |
User-agent: |
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) |
Hi!
Daniel Hartwig <address@hidden> skribis:
> From ec52416c2060cff11d0cb435df49207e5aa3dc7a Mon Sep 17 00:00:00 2001
> From: Daniel Hartwig <address@hidden>
> Date: Sun, 17 Feb 2013 16:38:31 +0800
> Subject: [PATCH] add hash-count for native tables
>
> * libguile/hashtab.c (scm_hash_count): New function. Count the number
> of elements in a hash table.
>
> * doc/ref/api-compound.texi (Hash Tables): Update examples and
> reference.
>
> * test-suite/tests/hash.test (hash-count): New test.
Looks like a worthy addition. A couple of comments:
> +To count all elements:
> +
> address@hidden
> +(hash-count #f h)
I would instead recommend (hash-count (const #t) h), and remove the
special case. WDYT?
> + return scm_oneplus(value);
Space before parenthesis.
Thanks,
Ludo’.
- Re: Hash table read syntax in guile 2.0, (continued)
- Re: Hash table read syntax in guile 2.0, Hengqing Hu, 2013/02/17
- Re: Hash table read syntax in guile 2.0, Daniel Hartwig, 2013/02/17
- Re: Hash table read syntax in guile 2.0, Hengqing Hu, 2013/02/17
- Re: Hash table read syntax in guile 2.0, Daniel Hartwig, 2013/02/17
- Re: Hash table read syntax in guile 2.0, Hengqing Hu, 2013/02/17
- Re: Hash table read syntax in guile 2.0, Daniel Hartwig, 2013/02/17
- Re: Hash table read syntax in guile 2.0, Hengqing Hu, 2013/02/17
- Re: Hash table read syntax in guile 2.0, Daniel Hartwig, 2013/02/18
- Re: Hash table read syntax in guile 2.0, Hengqing Hu, 2013/02/18
- Re: Hash table read syntax in guile 2.0, Daniel Hartwig, 2013/02/18
Re: Hash table read syntax in guile 2.0,
Ludovic Courtès <=