From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Output hash-table from a function Date: Sun, 22 Sep 2024 23:56:43 +0700 Message-ID: References: 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="1597"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 22 18:57:25 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ssPtl-0000Ec-87 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Sep 2024 18:57:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssPtM-00016Q-Aa; Sun, 22 Sep 2024 12:57:00 -0400 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 1ssPtJ-00015P-Hx for help-gnu-emacs@gnu.org; Sun, 22 Sep 2024 12:56:57 -0400 Original-Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssPtI-0004OM-4H for help-gnu-emacs@gnu.org; Sun, 22 Sep 2024 12:56:57 -0400 Original-Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-846bcb525f7so1019780241.3 for ; Sun, 22 Sep 2024 09:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727024215; x=1727629015; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=n9S19iCA9fTNYCeZVyy/sJqPSgOfu8EZORAbWvIPwmo=; b=NxXosqMa9RUKO4YC5oz96dWkN4O0vGYu21Fyqwsah8+o/PgG7P94+hxIznZYsmQMWG qNQ6unf/Y3OFu6j9aPXzqCv0ZDL0iq7XFyihIyTsqyRHGB2m+rULKJvNIOLVIWIONq8d p6Zk/OrG6z1PPlCILocbyD83StMRvm/mUmv3Pv7tHRTC3fmM6X/XCpF+RhcGkCJhzGYG Imd9kPySnof0zXV1+w/zB2xlgM8gh8rt5EjyC5X80j+36OQwm8hXi4SqQOkyF3VouWa6 c5aL0UkBTE6Fjg0HAW++lnupGcSiNmkvtXLBhhJTphiIKpcLMWfR6030sVgNMKXz8RjQ lPQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727024215; x=1727629015; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n9S19iCA9fTNYCeZVyy/sJqPSgOfu8EZORAbWvIPwmo=; b=TkDTBPGfCj2jIIasvbXj0scjQh449YArLZ8Pwmsgin7fEHPGUf46erqvrp0phQG5sg i9aFUF4e9mMkTpUwnCJ4gOsfaDF6Hm+taPSqWPAYIqv34yhpwjH2lFkEqSFAArSu5Ac0 aCmuDWvblQuY3RK5Zp+0wMs3O3VThHl9/lzKMOz0CRwrZCGcGQKrSiwt3rsjQwqf4TLj AXDl9Zqh6Z9cLncRUdehYqFWIX+HNSJItzbKHK/rz1pNnbdfSGaWtbxa/tTwxZPVvYT/ 5U+fbus9IFz1i40JJK0UBN3bNCcZZRMWxNhdVijx3ZrEZ21IIcUKy6KzLS5FMpAPZeVk uOfg== X-Gm-Message-State: AOJu0Yzl5+bx4Bv9NpA9eBdPakq2xx2ufjXxmX+Q0e2gKN0cFrYv8Sdp h1cugR/dtrHNyTJna7sDWJZ7oqdL2KEyWzHdUukdiRWpHEX6iJbynQtfflmBGW7cb+rggQmGlRS cmr9U3g3qFEscY/wdfBiOHc7Q/jcJKW4W X-Google-Smtp-Source: AGHT+IH7AaiMl11q0OmqqO6bLQ4TeO64q/+l7ginAgPftQHWP7i0fAr5ADQPR64O5ZJS6iDPiUS9dn983SbiEqY+/bU= X-Received: by 2002:a05:6102:2921:b0:492:9c32:5344 with SMTP id ada2fe7eead31-49fc9637e4dmr5352974137.18.1727024215119; Sun, 22 Sep 2024 09:56:55 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::936; envelope-from=yurivkhan@gmail.com; helo=mail-ua1-x936.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, 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-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148037 Archived-At: On Sun, 22 Sept 2024 at 23:03, Heime wrote: > > > > > > (defun xiakos-anctr (fpln) > > > > > > > > > > > > (if (hash-table-p fpln) > > > > > > > > > > > > (let ( (anctr (make-hash-table :test 'equal)) ) > > > > > > (maphash (lambda (waypt dirpath) > > > > > > (puthash > > > > > > waypt (not (file-directory-p dirpath)) > > > > > > anctr)) > > > > > > fpln)) )) > > > > > > > > > > Hint 1: What does your function to return right now? > > > > > > > > xiakos-anctr is certainly not returning a hash table, as I wanted > > > > I have made a check with (hash-table-p (xiakos-anctr flpn)) which returns > false. > > What gets returned is the return from maphash, which is always nil. Correct. > > > > > Hint 2: You=E2=80=99ve created a hash table, bound it to a local = variable, > > > > > then did a bunch of mutations to that hash table, and then what? > > From what I could conclude, the hash table gets lost. Also correct. So what change do you need to fix your xiakos-anctr function?