From: Trevor Arjeski <tmarjeski@gmail.com>
To: Richard Stallman <rms@gnu.org>
Cc: Psionic K <psionik@positron.solutions>, emacs-devel@gnu.org
Subject: Re: cond* Examples
Date: Thu, 09 Jan 2025 16:35:46 +0300 [thread overview]
Message-ID: <87r05c6rf1.fsf@gmail.com> (raw)
In-Reply-To: <E1tVjZn-0002HB-RS@fencepost.gnu.org> (Richard Stallman's message of "Wed, 08 Jan 2025 22:51:19 -0500")
No constructive comments from me, but this thread got me tinkering with `cond*'.
I'm embarassed to say that I spent too much time on this little snippet:
(cond*
((bind* (foo 1)
(bar 2)) :non-exit)
((eq foo bar) :eq)
((< foo bar) :lt)
(t :nothing))
In my mind, this should return `:lt', but it returns `:nothing'. After scratching my head, I looked
at the code and it seems that it conflicts with the manual entry:
"If a clause has only one element, or if its first element is ‘t’,
or if it ends with the keyword ‘:non-exit’, then this clause never
exits the ‘cond*’ construct."
Apparently, if a clause returns any keyword, it does a passthrough (see `cond*-non-exit-clause-p' ?)
Changing to this works:
(cond*
((bind* (foo 1)
(bar 2)) :non-exit) ; works with and without :non-exit
((eq foo bar) "eq")
((< foo bar) "lt")
(t :nothing))
;; returns "lt"
Anyway, sorry if this is off-topic.
next prev parent reply other threads:[~2025-01-09 13:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-06 14:55 cond* Examples Psionic K
2025-01-09 3:51 ` Richard Stallman
2025-01-09 13:35 ` Trevor Arjeski [this message]
2025-01-10 3:24 ` Richard Stallman
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=87r05c6rf1.fsf@gmail.com \
--to=tmarjeski@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=psionik@positron.solutions \
--cc=rms@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.