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 21:46:54 +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="15000"; 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 16:47:45 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 1ssNsG-0003mY-Kw for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Sep 2024 16:47:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssNrk-0006j5-2H; Sun, 22 Sep 2024 10:47:12 -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 1ssNri-0006bC-1A for help-gnu-emacs@gnu.org; Sun, 22 Sep 2024 10:47:10 -0400 Original-Received: from mail-vs1-xe33.google.com ([2607:f8b0:4864:20::e33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssNrg-0001DE-HG for help-gnu-emacs@gnu.org; Sun, 22 Sep 2024 10:47:09 -0400 Original-Received: by mail-vs1-xe33.google.com with SMTP id ada2fe7eead31-49bc7387371so1263275137.2 for ; Sun, 22 Sep 2024 07:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727016426; x=1727621226; 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=l8PT3hdmPGSE6HSqvumfQX52oiSxy2/K3NvrJdJbb60=; b=JdoFKxATWTTozLIcbzZf9sxJHTbeY/yQNpA2uRhTd6ZmrfsMVgD20ODNDeSRM2khil 2NZWbzOdsw29r0hkhqrvHvi/IGkIF7SceTXKqyN9a/uOL+4PAL4rfxwdPMQmK7R/668Q yWWBs2xz9OXLqxBqBSDluCWaYENW1RA9H6OndwWBhaSO00xbrcUKRJ1lGKdwC2FaZmAq ScJIChsStWpD8iyl/V/7VxYl7adR7Vi4ShEr/hgXl6YHDni6wUTMuFwxG9GGghpCdq1U 1qm3/+uDezrNtNiRlNjaPjyLYwcBkdo3cQ2km3+rU0fpQj4DnyCoMHkgPQUNRznLRpB0 t3Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727016426; x=1727621226; 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=l8PT3hdmPGSE6HSqvumfQX52oiSxy2/K3NvrJdJbb60=; b=VODGKlnbu/8ztuE80/Xn4/AA9fMOpzq5hRK+vOoxb6NRzumZORZc6vMd6xcOfNMbBL 67DC1h5BCdm6yiTClhvZsrJEpJroohlL+ysWcKXwzEbeb9sAIDMoJh+n7knf8mvjOGEO 2ZdLrXjT+5vq6olD2Yjqi0jpLTVzhlGJ41d43REsaiUMuqR8hcuUefNl2MnLKkeKqa0M mVGHRp8kkm5jJN2D94U7mYJu2i6HtTmWpf8ffuH5fMC1JOBbE94HmeNVrRWFip04m1zn utga6ua1tFxE7RuYqpzp4XODyNZmVRezlxTu1/h+NLOXLLfNraMTpSnlTQjHbGhgsCYf aN+A== X-Gm-Message-State: AOJu0YwpKSfoDrQwbnPLXFHdQBNJtjSzXNocj+qFjB3JUg1HqX0Dfk0J STtcnGvc3IzpMPLBoBWOTLP3mpwcKnKjyAMSzBEBikOSx7pKXRKmZXGOwuVtivBBb4NBaZ0V6qO /tpmxAH4Z8RP3ts1xi4tzxTA6854Z8oX0 X-Google-Smtp-Source: AGHT+IExrmaLsMFibCzIn1Ce9qE8Zu76mQvfSGFOvl1nHPklpoZ+wSeLsgwqkq5vvGO+ZHFahWDR0B85fYNknv92nXo= X-Received: by 2002:a05:6102:38d2:b0:48f:49c2:ff77 with SMTP id ada2fe7eead31-49fc7593667mr7214319137.16.1727016426079; Sun, 22 Sep 2024 07:47:06 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e33; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe33.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:148032 Archived-At: On Sun, 22 Sept 2024 at 18:48, Heime 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=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?