From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Output hash-table from a function Date: Sun, 22 Sep 2024 16:03:04 +0000 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="8371"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 22 18:03:36 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 1ssP3e-0001yt-Qm for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Sep 2024 18:03:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssP3O-0000YW-73; Sun, 22 Sep 2024 12:03:18 -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 1ssP3J-0000Y7-PW for help-gnu-emacs@gnu.org; Sun, 22 Sep 2024 12:03:13 -0400 Original-Received: from mail-4325.protonmail.ch ([185.70.43.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssP3G-00087c-W5 for help-gnu-emacs@gnu.org; Sun, 22 Sep 2024 12:03:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1727020988; x=1727280188; bh=HQgseEbI9GA1Jn6d0SpO3IHE6Jfw0j31GBxXoC0aLN0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=azOXi1d6VKoHbbePK2N3bSJGzQWFrQrCF4Bx4X3p3sqC0A0e77xAcDckPCL4RfxvU M3iTxiRa7E/c2dpoBl+9Kz6mbxpFbi0pNEQPJL7swyd6mVTjdjcvQuiooxfZIN4qaq ImfcyJPRRdHRsxJSuIsIpdLIJX6sEkkPf4FgDjl9CF0Rgpqn+06jC52R+luWPRmDMx nslNZjjhJgWJAzo5henVioZzatAoLaR6SBPpWhVWRDmJwf1rLcjh08G9UxHCDZoYJ/ GszKQUnQyA9XJIt9SzVYKtdk/MrkQYKbBBVtprx5pFwvzb5j2ZHoo3JBsmCR1xGJ4b ULvihDJKe+1tQ== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 1fdff96693cac4b1e534cf5000a048ad083ef35f Received-SPF: pass client-ip=185.70.43.25; envelope-from=heimeborgia@protonmail.com; helo=mail-4325.protonmail.ch 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_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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:148036 Archived-At: Sent with Proton Mail secure email. On Monday, September 23rd, 2024 at 3:59 AM, Heime wrote: >=20 >=20 >=20 >=20 >=20 > Sent with Proton Mail secure email. >=20 >=20 > On Monday, September 23rd, 2024 at 3:54 AM, Yuri Khan yuri.v.khan@gmail.c= om wrote: >=20 > > On Sun, 22 Sept 2024 at 22:16, Heime heimeborgia@protonmail.com wrote: > >=20 > > > > > (defun xiakos-anctr (fpln) > > > > >=20 > > > > > (if (hash-table-p fpln) > > > > >=20 > > > > > (let ( (anctr (make-hash-table :test 'equal)) ) > > > > > (maphash (lambda (waypt dirpath) > > > > > (puthash > > > > > waypt (not (file-directory-p dirpath)) > > > > > anctr)) > > > > > fpln)) )) > > > >=20 > > > > Hint 1: What does your function to return right now? > > >=20 > > > xiakos-anctr is certainly not returning a hash table, as I wanted > >=20 > > You are not answering the question. I am asking it because by > > answering it you will get closer to understanding the root of your > > issue. So, what is it returning? =20 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. =20 > > > > Hint 2: You=E2=80=99ve created a hash table, bound it to a local va= riable, > > > > then did a bunch of mutations to that hash table, and then what? > > >=20 > > > I want to call the function and store the hash table result in a let = statement > > >=20 > > > (let ( (anctr (xiakos-anctr flpn)) ) > >=20 > > This assumes xiakos-anctr returns the hash table. But, as you have > > seen, it does not return it. So what happens to the hash table you > > created in xiakos-anctr ? =20 >From what I could conclude, the hash table gets lost.