[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/taxy f5458d0 29/39: Change: taxy-map -> taxy-mapcar
From: |
ELPA Syncer |
Subject: |
[elpa] externals/taxy f5458d0 29/39: Change: taxy-map -> taxy-mapcar |
Date: |
Fri, 27 Aug 2021 10:57:35 -0400 (EDT) |
branch: externals/taxy
commit f5458d086226f9696f4d3d8b1403f408589df634
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Change: taxy-map -> taxy-mapcar
---
README.org | 16 ++++++++--------
taxy.el | 8 +++++---
taxy.info | 34 +++++++++++++++++-----------------
3 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/README.org b/README.org
index ff82761..3aadc4a 100644
--- a/README.org
+++ b/README.org
@@ -247,7 +247,7 @@ The ~:then~ function determines what happens to an object
after being taken in:
After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill
the taxy's hierarchy. *Note:* ~taxy-fill~ modifies the taxy given to it
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a
taxy copied with ~taxy-emptied~, which recursively copies a taxy without
~:objects~.
-To return a taxy in a more human-readable format (with only relevant fields
included), use ~taxy-plain~. You may also use ~taxy-map~ to replace objects in
a taxy with, e.g. a more useful representation.
+To return a taxy in a more human-readable format (with only relevant fields
included), use ~taxy-plain~. You may also use ~taxy-mapcar~ to replace objects
in a taxy with, e.g. a more useful representation.
** Dynamic taxys
:PROPERTIES:
@@ -399,13 +399,13 @@ Since taxys are structs, they may be stored in variables
and used in other struc
Note how the taxys defined in the first three variables are used in subsequent
taxys. As well, the ~ement-roomy-opened~ taxy has an "anonymous" taxy, which
collects any rooms that aren't collected by its sibling taxy (otherwise those
objects would be collected into the parent, "Opened" taxy, which may not always
be the most useful way to present the objects).
-Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the
rooms in the user's session, and then use ~taxy-map~ to replace the room
structs with useful representations for display:
+Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the
rooms in the user's session, and then use ~taxy-mapcar~ to replace the room
structs with useful representations for display:
#+BEGIN_SRC elisp
(taxy-plain
- (taxy-map (lambda (room)
- (list (ement-room--room-display-name room)
- (ement-room-id room)))
+ (taxy-mapcar (lambda (room)
+ (list (ement-room--room-display-name room)
+ (ement-room-id room)))
(taxy-fill (ement-session-rooms ement-session)
(taxy-emptied ement-roomy))))
#+END_SRC
@@ -450,9 +450,9 @@ If you happen to like macros, ~taxy~ works well with
threading (i.e. ~thread-las
(thread-last ement-roomy
taxy-emptied
(taxy-fill (ement-session-rooms ement-session))
- (taxy-map (lambda (room)
- (list (ement-room--room-display-name room)
- (ement-room-id room))))
+ (taxy-mapcar (lambda (room)
+ (list (ement-room--room-display-name room)
+ (ement-room-id room))))
taxy-plain)
#+END_SRC
diff --git a/taxy.el b/taxy.el
index 47bfb8c..335f7dd 100644
--- a/taxy.el
+++ b/taxy.el
@@ -101,8 +101,8 @@ when reusing taxy definitions."
(taxy-taxys taxy) (mapcar #'taxy-emptied (taxy-taxys taxy)))
taxy)
-(defun taxy-map (fn taxy)
- "Return TAXY, having replaced each object in it with the value of FN on it.
+(defun taxy-mapcar-objects (fn taxy)
+ "Return copy of TAXY, having replaced its objects with the value of FN on
each.
Replaces every object in TAXY and its descendants. Useful to
replace objects with a more useful form after classification."
(declare (indent defun))
@@ -111,9 +111,11 @@ replace objects with a more useful form after
classification."
;; (even `cl-loop' with `in-ref' hasn't worked).
(setf (taxy-objects taxy) (mapcar fn (taxy-objects taxy))
(taxy-taxys taxy) (cl-loop for taxy in (taxy-taxys taxy)
- collect (taxy-map fn taxy)))
+ collect (taxy-mapcar-objects fn taxy)))
taxy)
+(defalias 'taxy-mapcar #'taxy-mapcar-objects)
+
(cl-defun taxy-take-keyed (key-fn object taxy &key (key-name-fn #'identity))
"Take OBJECT into TAXY, adding new taxys dynamically.
Places OBJECT into a taxy in TAXY for the value returned by
diff --git a/taxy.info b/taxy.info
index ac6b346..23a84a8 100644
--- a/taxy.info
+++ b/taxy.info
@@ -249,7 +249,7 @@ should pass ‘taxy-fill’ a taxy copied with ‘taxy-emptied’,
which
recursively copies a taxy without ‘:objects’.
To return a taxy in a more human-readable format (with only relevant
-fields included), use ‘taxy-plain’. You may also use ‘taxy-map’ to
+fields included), use ‘taxy-plain’. You may also use ‘taxy-mapcar’ to
replace objects in a taxy with, e.g. a more useful representation.
* Menu:
@@ -434,13 +434,13 @@ parent, "Opened" taxy, which may not always be the most
useful way to
present the objects).
Using those defined taxys, we then fill the ‘ement-roomy’ taxy with
-all of the rooms in the user’s session, and then use ‘taxy-map’ to
+all of the rooms in the user’s session, and then use ‘taxy-mapcar’ to
replace the room structs with useful representations for display:
(taxy-plain
- (taxy-map (lambda (room)
- (list (ement-room--room-display-name room)
- (ement-room-id room)))
+ (taxy-mapcar (lambda (room)
+ (list (ement-room--room-display-name room)
+ (ement-room-id room)))
(taxy-fill (ement-session-rooms ement-session)
(taxy-emptied ement-roomy))))
@@ -486,9 +486,9 @@ If you happen to like macros, ‘taxy’ works well with
threading (i.e.
(thread-last ement-roomy
taxy-emptied
(taxy-fill (ement-session-rooms ement-session))
- (taxy-map (lambda (room)
- (list (ement-room--room-display-name room)
- (ement-room-id room))))
+ (taxy-mapcar (lambda (room)
+ (list (ement-room--room-display-name room)
+ (ement-room-id room))))
taxy-plain)
@@ -552,15 +552,15 @@ Tag Table:
Node: Top218
Node: Examples1101
Node: Usage9001
-Node: Dynamic taxys11084
-Node: Multi-level dynamic taxys13502
-Node: Reusable taxys15662
-Node: Threading macros19819
-Node: Magit section20340
-Node: Changelog20935
-Node: 01-pre21073
-Node: Development21167
-Node: License21338
+Node: Dynamic taxys11087
+Node: Multi-level dynamic taxys13505
+Node: Reusable taxys15665
+Node: Threading macros19834
+Node: Magit section20364
+Node: Changelog20959
+Node: 01-pre21097
+Node: Development21191
+Node: License21362
End Tag Table
- [elpa] externals/taxy 21e6fa6 22/39: Docs: Commentary, header, (continued)
- [elpa] externals/taxy 21e6fa6 22/39: Docs: Commentary, header, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy e56ae33 26/39: Meta: .gitignore, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 15eb9b7 31/39: Docs: Tidy, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 01e956a 04/39: Rename function, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 657823b 03/39: Docs: Tidy example, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy f115919 06/39: Add: taxy-copy and reverse args to taxy-fill, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy a94ab1c 05/39: Tidy, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 751e9d7 08/39: Show reusable taxys, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy d355d3a 14/39: Docs: Add mascot, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 3b253a6 21/39: Tidy: (taxy-fill) Argument order in labeled function, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy f5458d0 29/39: Change: taxy-map -> taxy-mapcar,
ELPA Syncer <=
- [elpa] externals/taxy 35c8f61 33/39: Add: (taxy-magit-section-indent), ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 4686e03 36/39: Add: (taxy-size), ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 34aa94d 23/39: Add: taxy-magit-section, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy a17e540 35/39: Docs: Show examples, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy aa0fe08 20/39: Change: taxy-copy -> taxy-emptied, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy c60a96f 12/39: Change: Rename taxy-simple, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 1699d3a 15/39: Docs: Clarify, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy fcc780f 27/39: Add: (taxy-take-keyed*), ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 4e132ab 28/39: Docs: Tidy, ELPA Syncer, 2021/08/27
- [elpa] externals/taxy 524b151 19/39: Tidy: (taxy-fill), ELPA Syncer, 2021/08/27