Commit 40e74ca5 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

utility: remove fwrap, table-alist

These utilities are not currently used; they can be reinstated later if needed.

fwrap was for composing a list of wrapper functions, except that the last was
the special case function to be wrapped. Better to just (define and) use
compose, with funcall (or call-function) as the base case.

table-alist was as the name implies, and was intended to help go between
internal table representations and external alist representations of
per-system variables.
parent a92bfb05
......@@ -28,9 +28,9 @@
#:stamp< #:stamps< #:stamp*< #:stamp<= ;; stamps
#:earlier-stamp #:stamps-earliest #:earliest-stamp
#:later-stamp #:stamps-latest #:latest-stamp #:latest-stamp-f
#:list-to-hash-set #:ensure-gethash #:table-alist ;; hash-table
#:list-to-hash-set #:ensure-gethash ;; hash-table
#:ensure-function #:access-at #:access-at-count ;; functions
#:call-function #:call-functions #:fwrap #:register-hook-function
#:call-function #:call-functions #:register-hook-function
#:lexicographic< #:lexicographic<= ;; version
#:simple-style-warning #:style-warn ;; simple style warnings
#:match-condition-p #:match-any-condition-p ;; conditions
......@@ -468,13 +468,6 @@ with the given ARGUMENTS"
"For each function in the list FUNCTION-SPECS, in order, call the function as per CALL-FUNCTION"
(map () 'call-function function-specs))
(defun fwrap (&rest functions)
(when functions
(destructuring-bind (first . rest) functions
(if rest
(call-function first #'(lambda () (apply 'fwrap rest)))
(call-function first)))))
(defun register-hook-function (variable hook &optional call-now-p)
"Push the HOOK function (a designator as per ENSURE-FUNCTION) onto the hook VARIABLE.
When CALL-NOW-P is true, also call the function immediately."
......@@ -535,14 +528,7 @@ Return two values: the entry after its optional computation, and whether it was
(defun list-to-hash-set (list &aux (h (make-hash-table :test 'equal)))
"Convert a LIST into hash-table that has the same elements when viewed as a set,
up to the given equality TEST"
(dolist (x list h) (setf (gethash x h) t)))
(defgeneric table-alist (table))
(defmethod table-alist ((table hash-table))
(loop :for k :being :the :hash-keys :of table :using (:hash-value v)
:collect (cons k v)))
(defmethod table-alist ((table cons))
table))
(dolist (x list h) (setf (gethash x h) t))))
;;; Lexicographic comparison of lists of numbers
(with-upgradability ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment