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 21:46:54 +0700 [thread overview]
Message-ID: <CAP_d_8XNmGxs0W6xVGdkMMJ_qb04Ua7BxN0=5v3wzT+80H984A@mail.gmail.com> (raw)
In-Reply-To: <Mofc_kTjjWhkWq_PGLCbTBg0gpCSESoKw-JYMxKImsJAceR-IRXMLkangO0jOONoT65WidJcVnRkEnT7E1fQDTpim1PizpNCHzwoExWDU1o=@protonmail.com>
On Sun, 22 Sept 2024 at 18:48, Heime <heimeborgia@protonmail.com> wrote:
> I want to write a function xiakos-anctr that taking the hash table xiakos,
You should really start naming your functions, arguments and variables
using words rather than random sequences.
> produces another hash-table, with the same keys but the associated value
> would be 1 (if directory path does not exist) or 0 (if the directory path exists).
>
> (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?
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?
next prev parent reply other threads:[~2024-09-22 14:46 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 [this message]
2024-09-22 15:16 ` Heime
2024-09-22 15:54 ` Yuri Khan
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAP_d_8XNmGxs0W6xVGdkMMJ_qb04Ua7BxN0=5v3wzT+80H984A@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.