From: Gene <gene.sullivan@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Define skeleton from alist?
Date: Wed, 13 Jul 2016 14:37:39 -0700 (PDT) [thread overview]
Message-ID: <a48da614-e2a7-4137-90d5-1c83badeeba6@googlegroups.com> (raw)
In-Reply-To: <mailman.1264.1468397506.26859.help-gnu-emacs@gnu.org>
At first blush it seems as you might have an impoverished mental model arising from an attitude and/or worldview in which Iteration, state-retention (EG via assignment via `setq'), and strings dominate.
Though `dolist' can iterate through a list, `mapcar' and its relatives can also access every element of a list.
You can think of `mapcar' as a higher order function analogous to a hand; it can hold any number of functions in it's tool-using hand ... even an on-the-fly anonymous lambda function.
When mapcar has a list element in it's hand the variants of c___r (with `car' and `cdr' qualifying as the simplest cases) can select subelements.
Thus I present the following for your `eval'uation:
(mapcar 'identity fountain-title-page-list)
(mapcar (lambda (elt)(identity elt)) fountain-title-page-list)
(mapcar (lambda (elt)(car elt)) fountain-title-page-list)
(mapcar (lambda (elt)(cdr elt)) fountain-title-page-list)
(mapcar (lambda (elt)(cons (car elt)(cdr elt))) fountain-title-page-list)
I'm hoping that what you learn can be used along with `concat' and `skeleton-read' to accomplish your desires.
Cheers!
Gene
next parent reply other threads:[~2016-07-13 21:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1264.1468397506.26859.help-gnu-emacs@gnu.org>
2016-07-13 21:37 ` Gene [this message]
2016-07-14 1:12 ` Define skeleton from alist? Paul Rankin
[not found] ` <mailman.1366.1468458751.26859.help-gnu-emacs@gnu.org>
2016-07-15 1:13 ` Gene
2016-07-13 8:11 Paul Rankin
2016-07-14 2:38 ` John Mastro
2016-07-14 6:00 ` Paul Rankin
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=a48da614-e2a7-4137-90d5-1c83badeeba6@googlegroups.com \
--to=gene.sullivan@gmail.com \
--cc=help-gnu-emacs@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.