unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Output hash-table from a function
Date: Sun, 22 Sep 2024 22:54:05 +0700	[thread overview]
Message-ID: <CAP_d_8WWpF7Xw72NGmh1b6qfA9mAuT1=BNB8bgVqau8AZRhvHg@mail.gmail.com> (raw)
In-Reply-To: <CoZDJbapGtYd1m8cRVDCXC9nKYRL10KKDymY6GH_oGgg0wI4BECOLNwHuTWG1lv1qyo4Qt0jk9y--owVUZ_BeJ3QlD2P-al5BJWJsJLEfrU=@protonmail.com>

On Sun, 22 Sept 2024 at 22:16, Heime <heimeborgia@protonmail.com> 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

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?

> > Hint 2: You’ve created a hash table, bound it to a local variable,
> > then did a bunch of mutations to that hash table, and then what?
>
> I want to call the function and store the hash table result in a let statement
>
> (let ( (anctr (xiakos-anctr flpn)) )

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?



  reply	other threads:[~2024-09-22 15:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21 22:34 Output hash-table from a function Heime
2024-09-22 11:47 ` Heime
2024-09-22 14:46   ` Yuri Khan
2024-09-22 15:16     ` Heime
2024-09-22 15:54       ` Yuri Khan [this message]
2024-09-22 15:59         ` Heime
2024-09-22 16:03           ` Heime
2024-09-22 16:56             ` Yuri Khan
2024-09-22 17:02               ` Heime
2024-09-23  5:57           ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP_d_8WWpF7Xw72NGmh1b6qfA9mAuT1=BNB8bgVqau8AZRhvHg@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).