From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.devel Subject: Re: Consider adding hash-keys and hash-values Date: Fri, 1 Nov 2013 20:05:45 -0700 Message-ID: References: <1EA2626D6F9E40C799F18421D8FD41B5@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1383361588 20930 80.91.229.3 (2 Nov 2013 03:06:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Nov 2013 03:06:28 +0000 (UTC) Cc: Daniel Colascione , Bozhidar Batsov , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 02 04:06:33 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 1VcRXk-0005RX-Fp for ged-emacs-devel@m.gmane.org; Sat, 02 Nov 2013 04:06:32 +0100 Original-Received: from localhost ([::1]:40571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcRXk-0005XX-0r for ged-emacs-devel@m.gmane.org; Fri, 01 Nov 2013 23:06:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcRXd-0005WZ-0e for emacs-devel@gnu.org; Fri, 01 Nov 2013 23:06:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcRXU-0000FN-DA for emacs-devel@gnu.org; Fri, 01 Nov 2013 23:06:24 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:49714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcRXU-0000F3-7S for emacs-devel@gnu.org; Fri, 01 Nov 2013 23:06:16 -0400 Original-Received: by mail-we0-f169.google.com with SMTP id q58so249516wes.0 for ; Fri, 01 Nov 2013 20:06:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=30b0nFCN5QlmsSBQASN10YxuW/CPW28xDRNd8hmS5uA=; b=Ljy3GL8tsww0eYi6tkyqXhk9GFOQ0r3orMvvKIvWJfFMAQv93+YQxP8PDa+HldtB7U oKsSwJNCqhIybJWuH/f6sI9cEuJlDXKBczko3nrQSTPB8ZztNr/4pB+clTOzbGrP9PG7 LGtpSg/dPnaI2nUi0iCXoac0q9nOvrap7ROK3rRlV/hnHKpRDfzkbJ7LkZcPXT4sc0qc u8I3ybDeOmZzO9PLaG6StoDwFugFIKcydVnSaZsRitJiNC7wPN2G4bLaai94Y9YsH7be Qt/IAT9l7DPb3SeiqRkBu+qEUZsus/TWrkoAJuwL5+aFXdb+oJRr2VfUhyreylB6zdjd jfIA== X-Gm-Message-State: ALoCoQlz+sTBTYUwPqAkpcoEFfE9FjRZE21DpwfHQLQkid4lFpRJhbvSP71Xp/T/ch++cBFxe2Ea X-Received: by 10.180.187.41 with SMTP id fp9mr4337329wic.33.1383361575271; Fri, 01 Nov 2013 20:06:15 -0700 (PDT) Original-Received: by 10.194.22.225 with HTTP; Fri, 1 Nov 2013 20:05:45 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: WcKUzf6KtPPluFudLv93v8K0CfY X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.169 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:164844 Archived-At: On Wed, Oct 30, 2013 at 6:11 AM, Stefan Monnier wrote: >>> (defun hash-keys (hashtable) > > It would have to be "hash-table-keys". > > But again, I'm not sure it provides a useful enough abstraction to > justify adding this one-liner in every Emacs executable. > > Tho, maybe we could introduce a new file "oneliners.el" where we could > collect such functions (probably most/all defined as `defsubst' so that > you can (eval-when-compile (require 'oneliners)). In my experience the usual reason to want a set of hash table keys or values is to iterate over them. Perhaps this would be a good time to revisit last year's discussion[0] of Daniel's elisp-generators library[1]? [0] http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00502.html [1] https://github.com/dcolascione/elisp-generators Josh