From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add-native-hashtable-helper-functions Date: Wed, 27 Mar 2013 21:55:26 +0800 Message-ID: References: <1364294433.2730.2.camel@Renee-desktop.suse> <874nfxvn4u.fsf@gnu.org> <871ub16k73.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1ff72e84f8404d8e86394 X-Trace: ger.gmane.org 1364392537 24069 80.91.229.3 (27 Mar 2013 13:55:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Mar 2013 13:55:37 +0000 (UTC) Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Mar 27 14:56:03 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UKqpZ-0001qA-3E for guile-devel@m.gmane.org; Wed, 27 Mar 2013 14:55:57 +0100 Original-Received: from localhost ([::1]:48033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKqpB-0000Wm-6p for guile-devel@m.gmane.org; Wed, 27 Mar 2013 09:55:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKqp7-0000Wg-Kb for guile-devel@gnu.org; Wed, 27 Mar 2013 09:55:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKqp5-00055U-Ti for guile-devel@gnu.org; Wed, 27 Mar 2013 09:55:29 -0400 Original-Received: from mail-oa0-f48.google.com ([209.85.219.48]:60486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKqp5-00055M-On; Wed, 27 Mar 2013 09:55:27 -0400 Original-Received: by mail-oa0-f48.google.com with SMTP id j1so8729057oag.35 for ; Wed, 27 Mar 2013 06:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=FQ3/jPnVLqeGw8ogxyxKzXH0C0UJOD4SlkPaxRLRKQw=; b=QQvGZiwIoe/l6URn3fEjni6EGUtnHS4N0gZAKg+4Y4wBf7wz913XbmdCwmEsCsP1xd PnotwFvJJ9sIjImAExqwFwYGi6anCeqgbHW8/xpkI9RMlSfF2regp6gc1/pCrrMqwmNc doQdYbKdBzorLHjs/pmVqKxDVx+rs9XZTVteKB+6FaBBmt6L1zLdTzIoBof0A5vyolri 7PieEpNCNBCHbW/OaLMr/7qL1EYxrCV6/NVH4jlY0M0QQmtwjK9sE7oVPiBJHAzcLBlj xBoyeIqmIPuchWpKovx0tylKk4KyYGpnpfVDPI1reVAX1Om4jez4fEeIMiftP9zhIw12 YJOg== X-Received: by 10.60.42.200 with SMTP id q8mr9963808oel.72.1364392527022; Wed, 27 Mar 2013 06:55:27 -0700 (PDT) Original-Received: by 10.182.109.99 with HTTP; Wed, 27 Mar 2013 06:55:26 -0700 (PDT) In-Reply-To: <871ub16k73.fsf@tines.lan> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.219.48 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16023 Archived-At: --001a11c1ff72e84f8404d8e86394 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Mar 27, 2013 at 9:33 PM, Mark H Weaver wrote: > ludo@gnu.org (Ludovic Court=C3=A8s) 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=E2=80=99t seem sufficiently common to warrant a new procedur= e. WDYT? > > FWIW, I think it would be reasonable to add 'hash-keys'. Many users > are accustomed to writing in a style that's made more convenient by > 'hash-keys', and in cases where efficiency is not crucial, I think > it's a fine style. Also, sometimes the values aren't needed. > > IMO, we can afford to add a few conveniences such as this. > > Thanks for saying that. And please consider 'hash-items' implemented with hash-count, it's common as well. And I'm not sure about hash-size myself, I won't insist on it. Thanks! > Mark > > --001a11c1ff72e84f8404d8e86394 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On W= ed, Mar 27, 2013 at 9:33 PM, Mark H Weaver <mhw@netris.org> wro= te:
ludo@gnu.org (Ludovic Court=C3=A8s) wri= tes:

> Nala Ginrut <nalaginrut@gma= il.com> skribis:
>
>> +(define (hash-keys table)
>> + =C2=A0"Return all the keys from hash table."
>> + =C2=A0(hash-map->list (lambda (x y) x) table))
>
> That doesn=E2=80=99t seem sufficiently common to warrant a new procedu= re. =C2=A0WDYT?

FWIW, I think it would be reasonable to add 'hash-keys'. =C2= =A0Many users
are accustomed to writing in a style that's made more convenient by
'hash-keys', and in cases where efficiency is not crucial, I think<= br> it's a fine style. =C2=A0Also, sometimes the values aren't needed.<= br>
IMO, we can afford to add a few conveniences such as this.


Than= ks for saying that.
And please consider 'hash-items' implemented with hash-count, it= 9;s common as well.

And I'm not sure about hash-size myself, I won't insist on it.

= Thanks!<= /div>
=C2=A0
=C2=A0 =C2=A0 =C2=A0 Mark


--001a11c1ff72e84f8404d8e86394--