From 75a9a156a0fab425ccc6821d38d7d20d0c2aba31 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 1 Sep 2020 16:26:39 +0100 Subject: Redefine >> macro as >-> in >.el I created a strangely named Elisp module, >.el, just to appease the CI gods. My gut tells me that this is a desperate idea and fails the smell test. I'm pretty eager to pass the linting phase of my Elisp CI, however, and I can always revert this. --- emacs/.emacs.d/wpc/>.el | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 emacs/.emacs.d/wpc/>.el (limited to 'emacs/.emacs.d/wpc/>.el') diff --git a/emacs/.emacs.d/wpc/>.el b/emacs/.emacs.d/wpc/>.el new file mode 100644 index 000000000000..68d8576b8079 --- /dev/null +++ b/emacs/.emacs.d/wpc/>.el @@ -0,0 +1,29 @@ +;;; >.el --- Small utility functions -*- lexical-binding: t -*- + +;; Author: William Carroll +;; Version: 0.0.1 +;; URL: https://git.wpcarro.dev/wpcarro/briefcase +;; Package-Requires: ((emacs "24")) + +;;; Commentary: +;; Originally I stored the `>>` macro in macros.el, but after setting up linting +;; for my Elisp in CI, `>>` failed because it didn't have the `macros-` +;; namespace. I created this module to establish a `>-` namespace under which I +;; can store some utilities that would be best kept without a cumbersome +;; namespace. + +;;; Code: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Library +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmacro >-> (&rest forms) + "Compose a new, point-free function by composing FORMS together." + (let ((sym (gensym))) + `(lambda (,sym) + (->> ,sym ,@forms)))) + + +(provide '>) +;;; >.el ends here -- cgit 1.4.1