[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 8bb3c34 363/385: the in-memory cache does
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 8bb3c34 363/385: the in-memory cache doesn't have to cache nil |
Date: |
Wed, 6 Oct 2021 00:00:05 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 8bb3c344c747b7f1ebda9aca3bb6c4196da45c4b
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
the in-memory cache doesn't have to cache nil
---
haskell-tng-util.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/haskell-tng-util.el b/haskell-tng-util.el
index 75f4b01..28e3d75 100644
--- a/haskell-tng-util.el
+++ b/haskell-tng-util.el
@@ -115,9 +115,10 @@ flush the cache when the universal argument is provided."
reset))
sym
nil
- reset))
+ reset
+ 'no-nil))
-(defun haskell-tng--util-cached-variable (work sym &optional no-work reset)
+(defun haskell-tng--util-cached-variable (work sym &optional no-work reset
no-nil)
"A variable cache over a function WORK.
If the SYM reference contains a cache of a previous call, it is
@@ -127,7 +128,7 @@ Otherwise WORK is called with no parameters and saved to
SYM.
Errors are NOT cached.
-nil return values are cached.
+nil return values are cached unless NO-NIL is non-nil.
NO-WORK skips WORK and only queries the cache.
@@ -137,7 +138,7 @@ RESET sets the variable to nil before doing anything."
(when (not (symbol-value sym))
(unless no-work
(set sym (funcall work))
- (unless (symbol-value sym)
+ (unless (or (symbol-value sym) no-nil)
(set sym 'cached-nil))))
(pcase (symbol-value sym)
('cached-nil nil)
- [nongnu] elpa/haskell-tng-mode 4480bb4 319/385: bump hsinspect/ghcflags versions, (continued)
- [nongnu] elpa/haskell-tng-mode 4480bb4 319/385: bump hsinspect/ghcflags versions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 99287ef 316/385: stack projectile defaults, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dbb2b7a 350/385: block / return-from instead of catch / throw, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d611f0b 322/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a717a50 331/385: allow workflow with qualified imports as default, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 70e649b 330/385: import qualified is even smarter, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5a064fd 328/385: hypen prefix asks to qualify the import, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c42b5c5 338/385: use url-copy-path instead of shelling out, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8405852 351/385: document bugs and ideas, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f429326 327/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8bb3c34 363/385: the in-memory cache doesn't have to cache nil,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode f5977b6 339/385: bugfix for source downloading, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9359c7b 349/385: cl-loop, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f5d76fc 348/385: tidy docs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b37524 360/385: bugfix for qualified imports when the cache was bad, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fe2b164 372/385: fix the build, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 63225d5 374/385: use .ghc.path to find hsinspect, build tool agnostic, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3d1122b 116/385: notes on regexps, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c3793b2 176/385: canonical until macro, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b7cb5b9 214/385: starting to create imenu, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5306ae2 217/385: fix type faces with constraints, ELPA Syncer, 2021/10/06