diff options
author | William Carroll <wpcarro@gmail.com> | 2020-09-01T09·17+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-09-01T09·17+0100 |
commit | fb5ec068ddd50f6bce41c7a0bad45673db787940 (patch) | |
tree | 19b4ff96983c08f451e7da5f58c95b8f6090ec84 /emacs/.emacs.d/wpc/sequence.el | |
parent | a638e15c0dd14a25e6f032b08de5ee1575677497 (diff) |
More Elisp linting
This should cover most of the remaining linting errors. After this, I expect fewer than ten linting errors.
Diffstat (limited to 'emacs/.emacs.d/wpc/sequence.el')
-rw-r--r-- | emacs/.emacs.d/wpc/sequence.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/emacs/.emacs.d/wpc/sequence.el b/emacs/.emacs.d/wpc/sequence.el index a5428ef04448..9da3ba4575f9 100644 --- a/emacs/.emacs.d/wpc/sequence.el +++ b/emacs/.emacs.d/wpc/sequence.el @@ -1,5 +1,9 @@ ;;; sequence.el --- Working with the "sequence" types -*- lexical-binding: t -*- + ;; Author: William Carroll <wpcarro@gmail.com> +;; Version: 0.0.1 +;; URL: https://git.wpcarro.dev/wpcarro/briefcase +;; Package-Requires: ((emacs "25.1")) ;;; Commentary: ;; Elisp supports a typeclass none as "sequence" which covers the following @@ -66,22 +70,22 @@ ;; (defprotocol sequence ;; :functions (reduce)) ;; (definstance sequence list -;; :reduce #'list/reduce -;; :filter #'list/filter -;; :map #'list/map) +;; :reduce #'list-reduce +;; :filter #'list-filter +;; :map #'list-map) ;; (definstance sequence vector ;; :reduce #'vector/reduce) ;; (definstance sequence string ;; :reduce #'string) -(defun sequence/classify (xs) +(defun sequence-classify (xs) "Return the type of `XS'." (cond ((listp xs) 'list) ((vectorp xs) 'vector) ((stringp xs) 'string))) -(defun sequence/reduce (acc f xs) +(defun sequence-reduce (acc f xs) "Reduce of `XS' calling `F' on x and `ACC'." (seq-reduce (lambda (acc x) @@ -91,12 +95,12 @@ ;; Elixir also turned everything into a list for efficiecy reasons. -(defun sequence/filter (p xs) +(defun sequence-filter (p xs) "Filter `XS' with predicate, `P'. Returns a list regardless of the type of `XS'." (seq-filter p xs)) -(defun sequence/map (f xs) +(defun sequence-map (f xs) "Maps `XS' calling `F' on each element. Returns a list regardless of the type of `XS'." (seq-map f xs)) |