all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: tomas@tuxteam.de
Cc: help-gnu-emacs@gnu.org
Subject: Re: Output an alist from a function
Date: Thu, 26 Sep 2024 20:58:18 +0000	[thread overview]
Message-ID: <OdVpwuUO0iQfXXNqz0Fibe_wVhsEM9Emu-Q3HIQqm-QEZr2IspEkTZa--2MIz4xr0O0KsQTIYUcVoGyCVZxHfK9IIWJLG_eGyWx7REfbq-k=@protonmail.com> (raw)
In-Reply-To: <ZvUi7qErzWChhcVj@tuxteam.de>






Sent with Proton Mail secure email.

On Thursday, September 26th, 2024 at 9:01 PM, tomas@tuxteam.de <tomas@tuxteam.de> wrote:

> On Thu, Sep 26, 2024 at 08:23:02AM +0000, Heime wrote:
> 
> > Sent with Proton Mail secure email.
> > 
> > On Thursday, September 26th, 2024 at 4:43 PM, tomas@tuxteam.de tomas@tuxteam.de wrote:
> > 
> > > On Wed, Sep 25, 2024 at 08:30:30PM +0000, Heime wrote:
> 
> 
> [...]
> 
> > For what I am doing, the problem is not acute and with your suggestion
> > towards mapc, I made
> > 
> > ;; 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)))
> 
> 
> 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?
> 
> (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 
various macros and their behavior.  Implementing multiple versions of the same 
functionality to serve as valuable exercises in grasping the nuances of these 
constructs. While generating an intermediate data structure may not be strictly 
necessary for outputting a formatted rendering, this experimentation should  
solidify my understanding of how these tools can be applied in different 
contexts.
 
> > > You'll always have inconsistencies. Removing them is an ongoing process
> > > which happens very carefully, and is in a steady state wrt introducing
> > > new ones.
> > > 
> > > At this stage, the evolution resembles that of human languages (which
> > > do have their sets of inconsistencies).
> > 
> > It is as Guy Steele used to describe a programming language. I attended one
> > of his speeches.
> 
> 
> 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 he 
has shown how the Temporal Logic of Actions is superior to human languages, 
and even to mathematics itself.
 
> Cheers
> --
> t



  reply	other threads:[~2024-09-26 20:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23 21:42 Output an alist from a function Heime
2024-09-24 15:04 ` tomas
2024-09-24 21:28   ` Heime
2024-09-25  4:39     ` tomas
2024-09-25 20:30       ` Heime
2024-09-26  4:43         ` tomas
2024-09-26  8:23           ` Heime
2024-09-26  9:01             ` tomas
2024-09-26 20:58               ` Heime [this message]
2024-09-24 16:19 ` Stephen Berman

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='OdVpwuUO0iQfXXNqz0Fibe_wVhsEM9Emu-Q3HIQqm-QEZr2IspEkTZa--2MIz4xr0O0KsQTIYUcVoGyCVZxHfK9IIWJLG_eGyWx7REfbq-k=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomas@tuxteam.de \
    /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.