Mark H Weaver skribis:
> l...@gnu.org (Ludovic Courtès) writes:
>
>> Nala Ginrut skribis:
>>
>>> +(define (hash-keys table)
>>> + "Return all the keys from hash table."
>>> + (hash-map->list (lambda (x y) x) table))
>>
>> That doesn’t seem sufficiently common to warrant a new procedure. WDYT?
On Wed, Mar 27, 2013 at 9:33 PM, Mark H Weaver wrote:
> l...@gnu.org (Ludovic Courtès) writes:
>
> > Nala Ginrut skribis:
> >
> >> +(define (hash-keys table)
> >> + "Return all the keys from hash table."
> >> + (hash-map->list (lambda (x y) x) table))
> >
> > That doesn’t seem sufficiently com
l...@gnu.org (Ludovic Courtès) writes:
> Nala Ginrut skribis:
>
>> +(define (hash-keys table)
>> + "Return all the keys from hash table."
>> + (hash-map->list (lambda (x y) x) table))
>
> That doesn’t seem sufficiently common to warrant a new procedure. WDYT?
FWIW, I think it would be reasona
hi Daniel!
First, I'll appreciate your patience. ;-)
On Wed, 2013-03-27 at 16:55 +0800, Daniel Hartwig wrote:
> On 27 March 2013 14:32, Nala Ginrut wrote:
> > On Wed, 2013-03-27 at 13:10 +0800, Daniel Hartwig wrote:
> >> On 27 March 2013 08:47, Nala Ginrut wrote:
> >> >
> >> > 在 2013-3-27 AM5:5
Hi!
Nala Ginrut skribis:
> Well, could you point me out how can I get the amount of items with
> hash-count in constant time?
You can’t, but Daniel is arguing that this should not be needed in the
first place, which makes sense to me.
> IMO, return the count of inner record is most explicit wa
On 27 March 2013 14:32, Nala Ginrut wrote:
> On Wed, 2013-03-27 at 13:10 +0800, Daniel Hartwig wrote:
>> On 27 March 2013 08:47, Nala Ginrut wrote:
>> >
>> > 在 2013-3-27 AM5:59,"Ludovic Courtès" 写道:
>> >
>> >
>> >>
>> >> Nala Ginrut skribis:
>> >>
>>
>> Hi now
>>
>> >> > * hash-items: get the am
On Wed, 2013-03-27 at 13:10 +0800, Daniel Hartwig wrote:
> On 27 March 2013 08:47, Nala Ginrut wrote:
> >
> > 在 2013-3-27 AM5:59,"Ludovic Courtès" 写道:
> >
> >
> >>
> >> Nala Ginrut skribis:
> >>
>
> Hi now
>
> >> > * hash-items: get the amount of items in the hash table
> >>
> >> There’s alread
On 27 March 2013 08:47, Nala Ginrut wrote:
>
> 在 2013-3-27 AM5:59,"Ludovic Courtès" 写道:
>
>
>>
>> Nala Ginrut skribis:
>>
Hi now
>> > * hash-items: get the amount of items in the hash table
>>
>> There’s already ‘hash-count’, recently added.
>>
>
> If I need to check the amount of items
> each
在 2013-3-27 AM5:59,"Ludovic Courtès" 写道:
>
> Nala Ginrut skribis:
>
> > * hash-items: get the amount of items in the hash table
>
> There’s already ‘hash-count’, recently added.
>
If I need to check the amount of items
each time in the loop, hash-count will do redundant visit for all items.
But h
Nala Ginrut skribis:
> * hash-items: get the amount of items in the hash table
There’s already ‘hash-count’, recently added.
> +SCM_DEFINE (scm_hash_size, "hash-size", 1, 0, 0,
> +(SCM table),
> +"Get the size of this hash table.")
> +#define FUNC_NAME s_scm_hash_size
>
I would be afraid that without an entry in the manual, people won't know
the functions exist, even if the docstrings are enough to explain what they
do.
Noah
On Tue, Mar 26, 2013 at 6:40 AM, Nala Ginrut wrote:
> Added three helper functions, they're so explicit that don't need any
> docs in th
nks!
>From 167e82e93ee59ac9a0244006ae9664d68877b4c8 Mon Sep 17 00:00:00 2001
From: Nala Ginrut
Date: Tue, 26 Mar 2013 16:00:54 +0800
Subject: [PATCH] Add native hashtable helper functions.
libguile/hashtab.c: Add hash-items and hash-size
libguile/hashtab.h
module/ice-9/boot-9.scm: Add hash-keys
12 matches
Mail list logo