[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 9ebd172 421/439: [-let] Generate differently named
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 9ebd172 421/439: [-let] Generate differently named symbols for temporary sources (makes |
Date: |
Tue, 04 Aug 2015 20:31:37 +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 7bd6b3b 400/439: Add dir entry to texinfo template, (continued)
- [elpa] externals/dash 7bd6b3b 400/439: Add dir entry to texinfo template, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5219ac0 422/439: [-let] Eliminate useless re-binding of symbols when sources are immutable, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0ef7384 395/439: Merge pull request #114 from fbergroth/update-test-case, Phillip Lord, 2015/08/04
- [elpa] externals/dash 349931e 399/439: Add @holomorph to list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1d4881f 413/439: Update README, Phillip Lord, 2015/08/04
- [elpa] externals/dash 36b7f49 419/439: [-let] Reuse the ignore-place predicate, Phillip Lord, 2015/08/04
- [elpa] externals/dash b308794 416/439: [Fix #73] Add a mention of -filter to -keep docstring, Phillip Lord, 2015/08/04
- [elpa] externals/dash 51a07b1 408/439: Merge pull request #127 from occidens/fixfn, Phillip Lord, 2015/08/04
- [elpa] externals/dash 8530742 410/439: Add @wasamasa and @occidens to list of contributors, Phillip Lord, 2015/08/04
- [elpa] externals/dash db784f8 403/439: Merge pull request #124 from occidens/skiptests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9ebd172 421/439: [-let] Generate differently named symbols for temporary sources (makes,
Phillip Lord <=
- [elpa] externals/dash 7d7a457 402/439: Allow run-tests.sh to skip tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3a3f528 396/439: Add info manual, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4bd6273 397/439: Invoke makeinfo on the generated .texi, Phillip Lord, 2015/08/04
- [elpa] externals/dash cf7ca23 415/439: [Fix #97] Add -remove-item, Phillip Lord, 2015/08/04
- [elpa] externals/dash 90056bd 401/439: Merge pull request #121 from holomorph/master, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3992e3c 406/439: Make `-fixfn' more robust at handling floats, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1fde888 407/439: Merge pull request #125 from wasamasa/feature-some, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2cc124b 423/439: [-let] Generate better code when skipping conses, Phillip Lord, 2015/08/04
- [elpa] externals/dash c61fc34 417/439: Add -remove-first/last, -map-first/last, -replace-first/last, Phillip Lord, 2015/08/04
- [elpa] externals/dash 40896b8 418/439: Fix the -let debug declaration, Phillip Lord, 2015/08/04