* Conditionals within dolist
@ 2022-10-14 21:13 Heime via Users list for the GNU Emacs text editor
2022-10-14 21:53 ` Emanuel Berg
0 siblings, 1 reply; 2+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2022-10-14 21:13 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
Is it possible to perform an if statement so that "list" is reversed when symbol "reverse" is equal to "'rv"?
(dolist (elm list)
(princ elm bufr)
(princ "\n" bufr))
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Conditionals within dolist
2022-10-14 21:13 Conditionals within dolist Heime via Users list for the GNU Emacs text editor
@ 2022-10-14 21:53 ` Emanuel Berg
0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg @ 2022-10-14 21:53 UTC (permalink / raw)
To: help-gnu-emacs
Heime via Users list for the GNU Emacs text editor wrote:
> Is it possible to perform an if statement so that "list" is
> reversed when symbol "reverse" is equal to "'rv"?
Actually that's not trivial in Elisp :P
(setq some-list '(1 2 3))
(setq rev t)
(when rev
(setq some-list (nreverse some-list)))
some-list ; (3 2 1)
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-14 21:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 21:13 Conditionals within dolist Heime via Users list for the GNU Emacs text editor
2022-10-14 21:53 ` Emanuel Berg
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.