From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico Date: Mon, 12 Apr 2021 12:14:17 +0200 Message-ID: <87pmyz4xom.fsf@posteo.net> References: <9c9af088-580f-9fb1-4d79-237a74ce605c@inventati.org> <874kgkxxs0.fsf@posteo.net> <87blamp5hy.fsf@posteo.net> <2ce73f33-8675-211a-9eb7-ea63de1a161e@yandex.ru> <871rbh6pd4.fsf@posteo.net> <87sg3w6co0.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40052"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 12 12:15:10 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVtb4-000AB1-6S for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Apr 2021 12:15:10 +0200 Original-Received: from localhost ([::1]:40326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVtb3-00030L-7k for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Apr 2021 06:15:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVtaO-0002Zi-Rt for emacs-devel@gnu.org; Mon, 12 Apr 2021 06:14:28 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:34113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVtaL-000749-6q for emacs-devel@gnu.org; Mon, 12 Apr 2021 06:14:28 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id DECB8240100 for ; Mon, 12 Apr 2021 12:14:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1618222462; bh=ZoblqA5/Smw8YmrXPg+kxYF6OMhS32Yvc6lZ3wmlMYY=; h=From:To:Cc:Subject:Date:From; b=aYJOlHMEKLY04XLrpGbKITm5lmzEmTvlIg2d/5ngcd98o5OvVVsbzzXTkADwIf+m6 /XcbHzx1BYZtPVa1uwczsNda9eCvzp0FEohswwCgv4mqAfu+IROAOrJl2J2ZFfEBX/ uhOF8d62VBJQ/GaQVETwFYVIvrO0FZFgym+h8ezX0YnERTKX+1zXD5hf9hzKuXH/uV 8+5VyH1P5WTuIJXaH/z4ZZJBjcx81avOswZdtrD9lC29VkytZi5rI8nfzx0ru9BEzP MzC4Cvsr1MYoP8+2aqZ3Qi7+jrt+16GfQap5PkFHJasxVXYJHQlC2j6FTtPCnV7ukU VC/cwpnE/FMcg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FJl2j1p4Pz6tmX; Mon, 12 Apr 2021 12:14:21 +0200 (CEST) In-Reply-To: (Jean Louis's message of "Mon, 12 Apr 2021 12:24:54 +0300") Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267948 Archived-At: Jean Louis writes: > * Philip Kaludercic [2021-04-11 18:53]: >> Jean Louis writes: >>=20 >> > One way I use for complex data structures is to have some kind of ID >> > and visual description, then by using the ID I fetch the data >> > structure later. >>=20 >> I'm not sure I completely understood your example. What do hash tables >> offer over lists of objects that can have a programmed >> representation? > > Completing read supports hash tables, once representation candidate > has been selected one can then use the key to get value of some quite > different or very complex data structure. > > (setq h (make-hash-table :test 'equal)) > (puthash "United States" [("ABC" 30 t)] h) > (puthash "Australia" 2 h) > (puthash "United Kingdom" 3 h) > > (message "%s" (gethash (completing-read "Choice: " h) h)) =E2=87=92 "[(AB= C 30 t)]" But don't you think that it is weird that completing-read returns the representation and not the object itself. That is exactly what I want to avoid by having the representation computed using a method. The best I can think of is using hash-maps to generate anonymous methods but even that seems to be looking at the issue backwards. --=20 Philip K.