From 8a3cf0b94b8f90d3c436fb61fac09957ed798ae7 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 17:16:58 +0100 Subject: [PATCH] update ht --- elpa/ht-20181216.1137/ht-autoloads.el | 22 ------------ elpa/ht-20181216.1137/ht-pkg.el | 2 -- elpa/ht-20190924.704/ht-autoloads.el | 15 ++++++++ elpa/ht-20190924.704/ht-pkg.el | 2 ++ .../ht.el | 34 +++++++++---------- 5 files changed, 33 insertions(+), 42 deletions(-) delete mode 100644 elpa/ht-20181216.1137/ht-autoloads.el delete mode 100644 elpa/ht-20181216.1137/ht-pkg.el create mode 100644 elpa/ht-20190924.704/ht-autoloads.el create mode 100644 elpa/ht-20190924.704/ht-pkg.el rename elpa/{ht-20181216.1137 => ht-20190924.704}/ht.el (92%) diff --git a/elpa/ht-20181216.1137/ht-autoloads.el b/elpa/ht-20181216.1137/ht-autoloads.el deleted file mode 100644 index c860d466..00000000 --- a/elpa/ht-20181216.1137/ht-autoloads.el +++ /dev/null @@ -1,22 +0,0 @@ -;;; ht-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - - -;;;### (autoloads nil "ht" "ht.el" (0 0 0 0)) -;;; Generated autoloads from ht.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ht" 'nil)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; ht-autoloads.el ends here diff --git a/elpa/ht-20181216.1137/ht-pkg.el b/elpa/ht-20181216.1137/ht-pkg.el deleted file mode 100644 index ca4710cd..00000000 --- a/elpa/ht-20181216.1137/ht-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ht" "20181216.1137" "The missing hash table library for Emacs" '((dash "2.12.0")) :commit "8ec3eb96ee63430fb24257e4aa8169b50cb7be12" :keywords '("hash table" "hash map" "hash") :authors '(("Wilfred Hughes" . "me@wilfred.me.uk")) :maintainer '("Wilfred Hughes" . "me@wilfred.me.uk")) diff --git a/elpa/ht-20190924.704/ht-autoloads.el b/elpa/ht-20190924.704/ht-autoloads.el new file mode 100644 index 00000000..4ab41150 --- /dev/null +++ b/elpa/ht-20190924.704/ht-autoloads.el @@ -0,0 +1,15 @@ +;;; ht-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("ht.el") (23994 46464 158317 313000)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; ht-autoloads.el ends here diff --git a/elpa/ht-20190924.704/ht-pkg.el b/elpa/ht-20190924.704/ht-pkg.el new file mode 100644 index 00000000..7f49ee1d --- /dev/null +++ b/elpa/ht-20190924.704/ht-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "ht" "20190924.704" "The missing hash table library for Emacs" '((dash "2.12.0")) :commit "66c5f9131242697fabaede5566d87ecda4c14b1f" :keywords '("hash table" "hash map" "hash") :authors '(("Wilfred Hughes" . "me@wilfred.me.uk")) :maintainer '("Wilfred Hughes" . "me@wilfred.me.uk")) diff --git a/elpa/ht-20181216.1137/ht.el b/elpa/ht-20190924.704/ht.el similarity index 92% rename from elpa/ht-20181216.1137/ht.el rename to elpa/ht-20190924.704/ht.el index 11ed0b79..c48a9999 100644 --- a/elpa/ht-20181216.1137/ht.el +++ b/elpa/ht-20190924.704/ht.el @@ -1,10 +1,10 @@ -;;; ht.el --- The missing hash table library for Emacs +;;; ht.el --- The missing hash table library for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 2013 Wilfred Hughes ;; Author: Wilfred Hughes ;; Version: 2.3 -;; Package-Version: 20181216.1137 +;; Package-Version: 20190924.704 ;; Keywords: hash table, hash map, hash ;; Package-Requires: ((dash "2.12.0")) @@ -96,26 +96,21 @@ user-supplied test created via `define-hash-table-test'." If KEY isn't present, return DEFAULT (nil if not specified)." (gethash key table default)) -(gv-define-setter ht-get (value table key) `(ht-set! ,table ,key ,value)) +;; Don't use `ht-set!' here, gv setter was assumed to return the value +;; to be set. +(gv-define-setter ht-get (value table key) `(puthash ,key ,value ,table)) (defun ht-get* (table &rest keys) "Look up KEYS in nested hash tables, starting with TABLE. The lookup for each key should return another hash table, except for the final key, which may return any value." - (if (cdr keys) - (apply #'ht-get* (ht-get table (car keys)) (cdr keys)) - (if keys - (ht-get table (car keys)) - table))) - -(gv-define-setter ht-get* (value table &rest keys) - `(if (cdr ',keys) - (let* ((first-key (car ',keys)) - (last-key (-last-item ',keys)) - (butlast-key (butlast (cdr ',keys))) - (h (apply #'ht-get* (ht-get ,table first-key) butlast-key))) - (ht-set! h last-key ,value)) - (ht-set! ,table (car ',keys) ,value))) + (while keys + (setf table (ht-get table (pop keys)))) + table) + +(put 'ht-get* 'compiler-macro + (lambda (_ table &rest keys) + (--reduce-from `(ht-get ,acc ,it) table keys))) (defun ht-update! (table from-table) "Update TABLE according to every key-value pair in FROM-TABLE." @@ -229,7 +224,8 @@ inverse of `ht<-alist'. The following is not guaranteed: (defun ht-contains? (table key) "Return 't if TABLE contains KEY." - (not (eq (ht-get table key 'ht--not-found) 'ht--not-found))) + (let ((not-found-symbol (make-symbol "ht--not-found"))) + (not (eq (ht-get table key not-found-symbol) not-found-symbol)))) (defalias 'ht-contains-p 'ht-contains?) @@ -241,6 +237,8 @@ inverse of `ht<-alist'. The following is not guaranteed: "Return true if the actual number of entries in TABLE is zero." (zerop (ht-size table))) +(defalias 'ht-empty-p 'ht-empty?) + (defun ht-select (function table) "Return a hash table containing all entries in TABLE for which FUNCTION returns a truthy value. -- 2.47.3