about summary refs log tree commit diff
path: root/emacs/.emacs.d/wpc/stack.el
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-09-01T15·26+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-09-01T15·26+0100
commit75a9a156a0fab425ccc6821d38d7d20d0c2aba31 (patch)
treea17ab9db0cac258633177a9cb9f6be302fbf3610 /emacs/.emacs.d/wpc/stack.el
parent718899c629bb1b8bd05285c2e8c5a1709e8e5226 (diff)
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.
Diffstat (limited to 'emacs/.emacs.d/wpc/stack.el')
-rw-r--r--emacs/.emacs.d/wpc/stack.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/emacs/.emacs.d/wpc/stack.el b/emacs/.emacs.d/wpc/stack.el
index 021004aec88d..c90f41e7602d 100644
--- a/emacs/.emacs.d/wpc/stack.el
+++ b/emacs/.emacs.d/wpc/stack.el
@@ -18,14 +18,19 @@
 
 ;;; Code:
 
-(require 'list)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Dependencies
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(cl-defstruct stack xs)
+(require 'list)
+(require '>)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Create
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(cl-defstruct stack xs)
+
 (defun stack-new ()
   "Create an empty stack."
   (make-stack :xs '()))
@@ -52,7 +57,7 @@
   "Push `X' on `XS'."
   (struct-update stack
                  xs
-                 (>> (list-cons x))
+                 (>-> (list-cons x))
                  xs))
 
 ;; TODO: How to return something like {(list-head xs), (list-tail xs)} in Elixir
@@ -63,7 +68,7 @@ Since I cannot figure out a nice way of return tuples in Elisp, if you want to
 look at the first element, use `stack-peek' before running `stack-pop'."
   (struct-update stack
                  xs
-                 (>> list-tail)
+                 (>-> list-tail)
                  xs))
 
 (defun stack-map-top (f xs)