From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Consider adding hash-keys and hash-values Date: Thu, 24 Oct 2013 17:16:03 +0300 Message-ID: <1EA2626D6F9E40C799F18421D8FD41B5@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="52692ba3_71f32454_41c" X-Trace: ger.gmane.org 1382624193 26111 80.91.229.3 (24 Oct 2013 14:16:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2013 14:16:33 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 24 16:16:39 2013 Return-path: Envelope-to: ged-emacs-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 1VZLiI-0008Ca-5b for ged-emacs-devel@m.gmane.org; Thu, 24 Oct 2013 16:16:38 +0200 Original-Received: from localhost ([::1]:54641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLiH-0006Zl-MW for ged-emacs-devel@m.gmane.org; Thu, 24 Oct 2013 10:16:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLi6-0006OD-AD for emacs-devel@gnu.org; Thu, 24 Oct 2013 10:16:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZLhx-0005Nd-RH for emacs-devel@gnu.org; Thu, 24 Oct 2013 10:16:26 -0400 Original-Received: from mail-bk0-x22d.google.com ([2a00:1450:4008:c01::22d]:49926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLhx-0005NV-KE for emacs-devel@gnu.org; Thu, 24 Oct 2013 10:16:17 -0400 Original-Received: by mail-bk0-f45.google.com with SMTP id r7so164313bkg.18 for ; Thu, 24 Oct 2013 07:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:message-id:subject:mime-version:content-type; bh=vY+Ip8EYUU1eMnIg7aUj+Nc4EA87/5ZHOvXBaQauVHY=; b=brsdCnO1aq6vuF2lVjZT2Zw3/T5WoQx69CmMncWSG/Dv3LuvccbgiispnwY1V6xFpw 1WIDUYnaoBnbjx/0KRP5COzVgxn7hBCNDkQfL1DL738FomMj9xfUzHkphBRob02mf8zu RotcGGAaarusbHXM7wnNOmv/9oSa9jne/YdedyMkUmJdJqivjJzfh51DUxxEFXptglWF KLgI1ZdaKHhe51RjvgKpe0t7l78khmT6y+ov21+Aukds9jXmi+HJKIAUuu/6pOYcEmZI JYiwIG3uk8ykyOTrT6lSrzTG8jRVgnBHQSE5IW/Zij/fWVMUVgIccKoIO13OnV/n9aLm v3pw== X-Received: by 10.204.197.73 with SMTP id ej9mr1607111bkb.51.1382624176372; Thu, 24 Oct 2013 07:16:16 -0700 (PDT) Original-Received: from [192.168.1.28] ([95.87.231.111]) by mx.google.com with ESMTPSA id qg7sm1463288bkb.6.2013.10.24.07.16.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 24 Oct 2013 07:16:15 -0700 (PDT) X-Mailer: sparrow 1.6.4 (build 1178) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4008:c01::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164511 Archived-At: --52692ba3_71f32454_41c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi everyone, I=E2=80=99ve seen the following functions (or their equivalents) inlined = in many packages: =20 (defun hash-keys (hashtable) =22Return a list of keys in HASHTABLE.=22 (let ((keys '())) (maphash (lambda (k v) (setq keys (cons k keys))) hashtable) keys)) (defun hash-values (hashtable) =22Return a list of values in HASHTABLE.=22 (let ((values '())) (maphash (lambda (k v) (setq keys (cons k values))) hashtable) keys)) Is there any particular reason why we don=E2=80=99t have them as part of = the standard set of hash functions=3F They are pretty useful and just abo= ut every programming language has them in its standard library. -- =20 Cheers, Bozhidar --52692ba3_71f32454_41c Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi everyone,<= /div>

I=E2=80=99ve seen the= following functions (or their equivalents) inlined in many packages:

(defun hash-keys (hashtable)
  =22Return a li= st of keys in HASHTABLE.=22
  (let ((keys '()))
=     (maphash (lambda (k v) (setq keys (cons k keys))) hashtable= )
    keys))

(defun hash-values (hashtable)
  =22Return a list of valu= es in HASHTABLE.=22
  (let ((values '()))
 =   (maphash (lambda (k v) (setq keys (cons k values))) hashtable)
    keys))

Is there any pa= rticular reason why we don=E2=80=99t have them as part of the standard se= t of hash functions=3F They are pretty useful and just about every progra= mming language has them in its standard library.

-- 
Cheers,
Bozhidar

--52692ba3_71f32454_41c--