From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: new function proposal alist-to-hash Date: Fri, 04 Oct 2019 09:58:43 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="75291"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Stefan Monnier , emacs-devel@gnu.org To: akrl@sdf.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 04 13:04:24 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iGLNo-000JTo-90 for ged-emacs-devel@m.gmane.org; Fri, 04 Oct 2019 13:04:24 +0200 Original-Received: from localhost ([::1]:46264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGLNm-0000c9-GN for ged-emacs-devel@m.gmane.org; Fri, 04 Oct 2019 07:04:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57499) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGKML-00020c-Df for emacs-devel@gnu.org; Fri, 04 Oct 2019 05:58:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGKMJ-0006FH-AI for emacs-devel@gnu.org; Fri, 04 Oct 2019 05:58:49 -0400 Original-Received: from ol.sdf.org ([205.166.94.20]:64202 helo=mx.sdf.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iGKMH-0006Ck-Cd for emacs-devel@gnu.org; Fri, 04 Oct 2019 05:58:47 -0400 Original-Received: from sdf.org (IDENT:akrl@otaku.sdf.org [205.166.94.8]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id x949whKj008119 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Fri, 4 Oct 2019 09:58:43 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id x949whUm014634; Fri, 4 Oct 2019 09:58:43 GMT X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:240558 Archived-At: I just wanted elaborate a little more on the following two points: - I think is quite useful to be able to create in a concise and explicit way nested hash tables. This is a common feature of many "modern" languages. Here both solutions compared: (alist-to-hash '((a . x) (b . ((i . j) (k . l))) (c . y))) (map-into `((a . x) (b . ,(map-into '((i . j) (k . l)) 'hash-table)) (c . y)) 'hash-table) - map-into does not let you tweak make-hash-table parameters. This is especially a limitation regarding :test so is effectively a solution to say ~50% of the use cases. Bests Andrea -- akrl@sdf.org