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 an alist from a function Date: Thu, 26 Sep 2024 20:58:18 +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="31995"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 26 22:59:12 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 1stvZw-00088Y-Is for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Sep 2024 22:59:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stvZI-0002VO-AY; Thu, 26 Sep 2024 16:58:32 -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 1stvZG-0002VC-Lw for help-gnu-emacs@gnu.org; Thu, 26 Sep 2024 16:58:30 -0400 Original-Received: from mail-40132.protonmail.ch ([185.70.40.132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stvZE-0006ba-3A for help-gnu-emacs@gnu.org; Thu, 26 Sep 2024 16:58:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1727384300; x=1727643500; bh=EcUX26NuG4S0rnddYMxFuQEp0QPCTrSCuUq0Qb8V3bs=; 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=n+WnBTPGNbR2Lr7AqJbQEaqQIJ5JqqgH9oUCFktemii5ZKPmKrgvzhEGvCBqV3Uv4 Beqv3NnV/nq2qbf6MHPb1few46YqxnEtGYGgRo09f+qnhqOeasdMey68nDRlJRu/PA f2C6CTNCZ4a8Y4tfroFaqAeU1Qkt5D8aQpSTNztI9Beg+SsbxffVzaJ45fqWc1q/CN a6leoukUcfVkG6BwaV3xyG1BCDmAElzCtdOhDwZBU+vkkHd4lS7XeItFymDpAwTIWG Bk8Z29cdFj4+9sPLoW/GytiD53Sh5+inZfTQ+hWnKXdfeV9uL0bzh1nx7PqbF/8URz fnz6OINeTVTxQ== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 19499a1f20015ff26c0290b094fb1527a1a3631b Received-SPF: pass client-ip=185.70.40.132; envelope-from=heimeborgia@protonmail.com; helo=mail-40132.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.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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:148076 Archived-At: Sent with Proton Mail secure email. On Thursday, September 26th, 2024 at 9:01 PM, tomas@tuxteam.de wrote: > On Thu, Sep 26, 2024 at 08:23:02AM +0000, Heime wrote: >=20 > > Sent with Proton Mail secure email. > >=20 > > On Thursday, September 26th, 2024 at 4:43 PM, tomas@tuxteam.de tomas@tu= xteam.de wrote: > >=20 > > > On Wed, Sep 25, 2024 at 08:30:30PM +0000, Heime wrote: >=20 >=20 > [...] >=20 > > For what I am doing, the problem is not acute and with your suggestion > > towards mapc, I made > >=20 > > ;; Initialize an empty alist to hold output > > (let ( (output-alist '()) ) > > ;; `mapc' iterates over an alist in a manner similar to how ;;` maphash= ' processes a hash table. > > (mapc (lambda (entry) > > (let ( (waypt (car entry)) > > (dir-path (cdr entry)) ) > > ;; Push the result to the front of the output alist > > (push (cons waypt (not (file-directory-p dir-path))) > > output-alist))) > > fpln) > > ;; Reverse the list to maintain the original order > > (reverse output-alist))) >=20 >=20 > If all you need is to print a formatted rendering of the alist/hash, > perhaps you can skip the generation of an intermediate data structure? >=20 > (I don't know what your greater plan is, so perhaps that musing is > irrelevant) My goal is to explore different approaches to deepen my understanding of=20 various macros and their behavior. Implementing multiple versions of the s= ame=20 functionality to serve as valuable exercises in grasping the nuances of the= se=20 constructs. While generating an intermediate data structure may not be stri= ctly=20 necessary for outputting a formatted rendering, this experimentation should= =20 solidify my understanding of how these tools can be applied in different=20 contexts. =20 > > > You'll always have inconsistencies. Removing them is an ongoing proce= ss > > > which happens very carefully, and is in a steady state wrt introducin= g > > > new ones. > > >=20 > > > At this stage, the evolution resembles that of human languages (which > > > do have their sets of inconsistencies). > >=20 > > It is as Guy Steele used to describe a programming language. I attended= one > > of his speeches. >=20 >=20 > After all, programming languages are also human languages, with all their > cultural traits, tribalities, identity facets, yadda, yadda. Had I the > choice today, I'd study programming language anthropology. Have worked with Leslie Lamport (Turing Award Winner 2013 by the ACM) and h= e=20 has shown how the Temporal Logic of Actions is superior to human languages,= =20 and even to mathematics itself. =20 > Cheers > -- > t