From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Shankar Rao Newsgroups: gmane.emacs.devel Subject: Is there utility in making hash-table-{keys, values} built-in functions? Date: Thu, 28 Nov 2024 12:53:25 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006e8f580627f7bb99" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4018"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 28 15:30:51 2024 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 1tGfXf-0000x4-AJ for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Nov 2024 15:30:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGfX7-00080C-Pr; Thu, 28 Nov 2024 09:30:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGd5W-00028E-FM for emacs-devel@gnu.org; Thu, 28 Nov 2024 06:53:38 -0500 Original-Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGd5V-0005Kl-38 for emacs-devel@gnu.org; Thu, 28 Nov 2024 06:53:38 -0500 Original-Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-4af58808485so205304137.3 for ; Thu, 28 Nov 2024 03:53:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732794815; x=1733399615; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RU7bvdq4A//lYX+EmZpYg9RZ3zKM47SWZa8jAU7c5io=; b=C+LmLURx1E2kXBDm1lYPz3RVPhQ0bBD9LM06nh2ndKjM+2monkzo5c9uTy40VunRab wKEfYRo7ZmzbShoKN/H7e59zF+W3YJfowpgJM3ON2/+5EvrYlLG3UqLfp3AKXIFak2mh c46way691/LzyzJ1TpsFWFM9fcn4jjQiyMoBqFGHq1n0uxJaBqSqnk03yAUoIKqniC7Q J3u8PW/amYVkxRLt5HyPuPcoL6U9sxlGoFPbsjD26zgtm2gMhGrA+3Ul/pnRsNBGbt5C cXu2NpPraRrkDKqf0RMklpKwlSHVaeFbVsvcM+V2BOu415mwyIibcUkw5GquN7CYiVdQ GMcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732794815; x=1733399615; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RU7bvdq4A//lYX+EmZpYg9RZ3zKM47SWZa8jAU7c5io=; b=r4+qhPf7i3acAaBwOuFy/eY9SOIo5TWG3b+tRe4sbnrGgtebFpwVEvWi4YudWUFaAP mzfGwT4E+Ub535/EHAajOg0fohiGAMes95kKGAn9caZpGKlMMgPqmfubTYvcu/87fUoA 21U/2Oa257Zo8SxFT7apIUL9X25VP7JolrShJDZ0VxXfm0ysH3w5N9AHi7RqzGE+t8WP qCsIOejHltNlGiAuiLhk1IQSPq4JUGc0/c7now5ZKMePge6mpfhIm+41PgBuumI9ChaG R8U0nO4W6CpBK2nZcrY1htd2drFweJim3dweCM9GNzeG+CNADFZnpjtuNlK/Qi2gH0aO 8nUg== X-Gm-Message-State: AOJu0YwYFlMiJIzza7GjOwWqnIcv/h+EFT81644NMzobznzuWQD7EckZ UmbJ3yNgTEJswVwAiqq8vY7NnSfGpeM0LJ0ayVwbKFJc5uMJF17ONUZ5Nvukv/xBYH+Q9vSQBcq 2ZEZzd/JAJgeIjXWnHI97170YflkQkA== X-Gm-Gg: ASbGncuXQndBcHtanLtzMoIb9FWGs/MgDABOdRXSakA4F0qcMf+1XBvlqxoPCMapLpN Q24iTQnXUqzjgG3A56MBqgnl02M5SJq8= X-Google-Smtp-Source: AGHT+IEgP3NE5oIYAe2yErQpkgSeOmLtg2CB4bJbSikhZskAcZUaSacn6Qjpr6PVL3dtowpFjNM3I9p2M+I5nXwT/nk= X-Received: by 2002:a67:c784:0:b0:4af:469b:d3ae with SMTP id ada2fe7eead31-4af469bd53dmr6046897137.27.1732794815252; Thu, 28 Nov 2024 03:53:35 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::e36; envelope-from=shankar.rao@gmail.com; helo=mail-vs1-xe36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 28 Nov 2024 09:29:46 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325816 Archived-At: --0000000000006e8f580627f7bb99 Content-Type: text/plain; charset="UTF-8" Hello all, I noticed that the functions hash-table-keys and hash-table-values are just wrappers around maphash. This means that there is no way to iterate over a hash-table without using a lambda. Would it be useful or worthwhile to implement these directly in C? I don't know much about low-level Emacs development, but having these as built-ins could make iteration of a hash-table a little faster and easier to debug. Shankar --0000000000006e8f580627f7bb99 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello all,

I noticed that th= e functions hash-table-keys and hash-table-values are just wrappers around = maphash. This means that there is no way to iterate over a hash-table witho= ut using a lambda.

Would it be useful or worthwhil= e to implement these directly in C? I don't know much about low-level E= macs development, but having these as built-ins could make iteration of a h= ash-table a little faster and easier to debug.

Sha= nkar
--0000000000006e8f580627f7bb99--