[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 9ebd172 421/426: [-let] Generate differently named
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 9ebd172 421/426: [-let] Generate differently named symbols for temporary sources (makes |
Date: |
Tue, 04 Aug 2015 19:39:21 +0000 |
branch: externals/dash
commit 9ebd17257b5ac71c9d998b39bfae9522fdef5833
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>
[-let] Generate differently named symbols for temporary sources (makes
readable generated code)
---
dash.el | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/dash.el b/dash.el
index ab906e2..a5d6d62 100644
--- a/dash.el
+++ b/dash.el
@@ -1216,6 +1216,16 @@ sorts it in descending order."
(-sort comp)
(-map 'cdr))))
+(defvar dash--source-counter 0
+ "Monotonic counter for generated symbols.")
+
+(defun dash--match-make-source-symbol ()
+ "Generate a new dash-source symbol.
+
+All returned symbols are guaranteed to be unique."
+ (prog1 (make-symbol (format "--dash-source-%d--" dash--source-counter))
+ (setq dash--source-counter (1+ dash--source-counter))))
+
(defun dash--match-ignore-place-p (symbol)
"Return non-nil if SYMBOL is a symbol and starts with _."
(and (symbolp symbol)
@@ -1253,7 +1263,7 @@ sorts it in descending order."
(defun dash--match-cons (match-form source)
"Setup a cons matching environment and call the real matcher."
- (let ((s (make-symbol "--dash-source--"))
+ (let ((s (dash--match-make-source-symbol))
(n 0)
(m match-form))
(while (and (consp m)
@@ -1322,7 +1332,7 @@ SOURCE is a proper or improper list."
(defun dash--match-vector (match-form source)
"Setup a vector matching environment and call the real matcher."
- (let ((s (make-symbol "--dash-source--")))
+ (let ((s (dash--match-make-source-symbol)))
(cond
;; don't bind `s' if we only have one sub-pattern
((= (length match-form) 1)
@@ -1380,7 +1390,7 @@ is discarded."
"Setup a kv matching environment and call the real matcher.
kv can be any key-value store, such as plist, alist or hash-table."
- (let ((s (make-symbol "--dash-source--")))
+ (let ((s (dash--match-make-source-symbol)))
(cond
;; don't bind `s' if we only have one sub-pattern (&type key val)
((= (length match-form) 3)
- [elpa] externals/dash 703bb59 297/426: Convert -zip to support variable-length arguments, (continued)
- [elpa] externals/dash 703bb59 297/426: Convert -zip to support variable-length arguments, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3132ae0 314/426: Alias -tail to nthcdr, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4098ea0 285/426: Merge pull request #74 from YoungFrog/dashfontifix, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0c045f2 369/426: Highlight with el instead of cl, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5086d24 293/426: Merge pull request #60 from rejeep/cask, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1fde888 407/426: Merge pull request #125 from wasamasa/feature-some, Phillip Lord, 2015/08/04
- [elpa] externals/dash 51a07b1 408/426: Merge pull request #127 from occidens/fixfn, Phillip Lord, 2015/08/04
- [elpa] externals/dash ffa37bf 425/426: Merge pull request #129 from holomorph/docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 63ec298 308/426: Merge pull request #92 from Fuco1/outer-product, Phillip Lord, 2015/08/04
- [elpa] externals/dash 00549e4 307/426: Add missing fontification keywords, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9ebd172 421/426: [-let] Generate differently named symbols for temporary sources (makes,
Phillip Lord <=
- [elpa] externals/dash c134705 377/426: Fix compile warning, Phillip Lord, 2015/08/04
- [elpa] externals/dash 40896b8 418/426: Fix the -let debug declaration, Phillip Lord, 2015/08/04
- [elpa] externals/dash 79c23bb 282/426: Merge pull request #70 from Fuco1/debug-decl, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5d25ed2 275/426: Release 2.5.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2cc124b 423/426: [-let] Generate better code when skipping conses, Phillip Lord, 2015/08/04
- [elpa] externals/dash b7c2f9a 381/426: Work around byte compiler in -if-let*, Phillip Lord, 2015/08/04
- [elpa] externals/dash b201f0c 281/426: Add debug declarations and move indent declarations into `declare`, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4e6a965 294/426: Still better debug declarations, Phillip Lord, 2015/08/04
- [elpa] externals/dash dab0d1c 384/426: Merge pull request #107 from fbergroth/workaround-byte-compiler, Phillip Lord, 2015/08/04
- [elpa] externals/dash 446c522 375/426: Release 2.10.0, Phillip Lord, 2015/08/04